Skip to content

Commit

Permalink
Map: Get rid of 'goto'
Browse files Browse the repository at this point in the history
  • Loading branch information
dl3sdo committed Jan 24, 2025
1 parent 260a4a1 commit 4463f73
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/core/map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -889,17 +889,17 @@ std::size_t Map::deleteIrregularObjects()
std::set<Object*> unhandled;
for (auto object : irregular_objects)
{
for (auto part : parts)
if (std::none_of(begin(parts), end(parts), [&result, object](MapPart* const part) {
if (part->deleteObject(object))
{
++result;
return true;
}
return false;
}))
{
if (part->deleteObject(object))
{
++result;
goto next_object;
}
unhandled.insert(object);
}
unhandled.insert(object);
next_object:
; // nothing else
}

irregular_objects.swap(unhandled);
Expand Down

0 comments on commit 4463f73

Please sign in to comment.