1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-12 09:09:09 +00:00

Codechange: Replace FOR_ALL_ENGINES with range-based for loops

This commit is contained in:
glx
2019-12-15 22:45:18 +01:00
committed by Niels Martin Hansen
parent 1c92ba8ebe
commit 1f6b3a37f9
16 changed files with 50 additions and 81 deletions

View File

@@ -1236,8 +1236,7 @@ void CommitVehicleListOrderChanges()
{
/* Pre-sort engines by scope-grfid and local index */
std::vector<EngineID> ordering;
Engine *e;
FOR_ALL_ENGINES(e) {
for (const Engine *e : Engine::Iterate()) {
ordering.push_back(e->index);
}
std::sort(ordering.begin(), ordering.end(), EnginePreSort);