|
|
@@ -1062,7 +1062,10 @@ public:
|
|
|
auto hero = clusterGoal.hero;
|
|
|
auto role = evaluationContext.evaluator.aiNk->heroManager->getHeroRoleOrDefaultInefficient(hero);
|
|
|
|
|
|
- std::vector<std::pair<ObjectInstanceID, ClusterObjectInfo>> objects(cluster->objects.begin(), cluster->objects.end());
|
|
|
+ std::vector<std::pair<ObjectInstanceID, ClusterObjectInfo>> objects;
|
|
|
+ objects.reserve(cluster->objects.size());
|
|
|
+ for (const auto& obj : cluster->objects)
|
|
|
+ objects.emplace_back(obj.first, obj.second);
|
|
|
|
|
|
std::sort(objects.begin(), objects.end(), [](std::pair<ObjectInstanceID, ClusterObjectInfo> o1, std::pair<ObjectInstanceID, ClusterObjectInfo> o2) -> bool
|
|
|
{
|