1
0
mirror of https://github.com/anope/anope.git synced 2026-07-01 06:36:39 +02:00

Start migrating to range-based for loops.

This commit is contained in:
Sadie Powell
2023-10-10 21:14:50 +01:00
parent dc371aad6d
commit a3241065c5
146 changed files with 1157 additions and 1459 deletions
+4 -5
View File
@@ -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())