mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-13 19:54:17 +02:00
Minor optimization, saves few seconds.
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user