diff options
author | Sadie Powell <sadie@witchery.services> | 2023-10-10 21:14:50 +0100 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2023-10-11 15:51:52 +0100 |
commit | a3241065c55fd2a69e8793b89a5d0b1a957b3fd0 (patch) | |
tree | 82f80ce2f3bbbdc1c1ef05fe611093cf0b34eab6 /src/serialize.cpp | |
parent | dc371aad6d059dbf7f30f6878c680532bedd4146 (diff) |
Start migrating to range-based for loops.
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()) |