mirror of
https://github.com/vcmi/vcmi.git
synced 2025-02-03 13:01:33 +02:00
Minor optimization, saves few seconds.
This commit is contained in:
parent
7d7b51d0db
commit
40f28778c2
@ -475,8 +475,7 @@ void CZonePlacer::assignZones(const CMapGenOptions * mapGenOptions)
|
||||
else
|
||||
distances.push_back(std::make_pair(zone.second, std::numeric_limits<float>::max()));
|
||||
}
|
||||
boost::sort(distances, compareByDistance);
|
||||
distances.front().first->addTile(pos); //closest tile belongs to zone
|
||||
boost::min_element(distances, compareByDistance)->first->addTile(pos); //closest tile belongs to zone
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -504,8 +503,7 @@ void CZonePlacer::assignZones(const CMapGenOptions * mapGenOptions)
|
||||
else
|
||||
distances.push_back (std::make_pair(zone.second, std::numeric_limits<float>::max()));
|
||||
}
|
||||
boost::sort (distances, compareByDistance);
|
||||
distances.front().first->addTile(pos); //closest tile belongs to zone
|
||||
boost::min_element(distances, compareByDistance)->first->addTile(pos); //closest tile belongs to zone
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user