diff options
Diffstat (limited to 'src/serialize.cpp')
-rw-r--r-- | src/serialize.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/serialize.cpp b/src/serialize.cpp index b43be2dcf..03d9ed626 100644 --- a/src/serialize.cpp +++ b/src/serialize.cpp @@ -34,9 +34,8 @@ void Serialize::RegisterTypes() void Serialize::CheckTypes() { - for (std::map<Anope::string, Serialize::Type *>::const_iterator it = Serialize::Type::GetTypes().begin(), it_end = Serialize::Type::GetTypes().end(); it != it_end; ++it) + for (const auto &[_, t] : Serialize::Type::GetTypes()) { - Serialize::Type *t = it->second; t->Check(); } } @@ -124,13 +123,13 @@ Type::~Type() { /* null the type of existing serializable objects of this type */ if (Serializable::SerializableItems != NULL) - for (std::list<Serializable *>::iterator it = Serializable::SerializableItems->begin(); it != Serializable::SerializableItems->end(); ++it) + { + for (auto *s : *Serializable::SerializableItems) { - Serializable *s = *it; - if (s->s_type == this) s->s_type = NULL; } + } std::vector<Anope::string>::iterator it = std::find(TypeOrder.begin(), TypeOrder.end(), this->name); if (it != TypeOrder.end()) |