From 5d410a42431d092cadb2783b9fb9d6ce5d1c0c5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Zieli=C5=84ski?= Date: Fri, 14 Mar 2025 20:14:57 +0100 Subject: [PATCH] Use vstd::contains --- lib/rmg/CZonePlacer.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/rmg/CZonePlacer.cpp b/lib/rmg/CZonePlacer.cpp index 1ca494ff5..cf06b8209 100644 --- a/lib/rmg/CZonePlacer.cpp +++ b/lib/rmg/CZonePlacer.cpp @@ -1100,14 +1100,14 @@ void CZonePlacer::dropRandomRoads(vstd::RNG * rand) auto current = stack.top(); stack.pop(); - if(visited.find(current) != visited.end()) + if(vstd::contains(visited, current)) continue; visited.insert(current); for(auto & neighbor : roadGraph[current]) { - if(visited.find(neighbor.first) == visited.end()) + if(!vstd::contains(visited, neighbor.first)) { stack.push(neighbor.first); } @@ -1117,7 +1117,7 @@ void CZonePlacer::dropRandomRoads(vstd::RNG * rand) //Check if all zones with roads are still reachable for(auto zoneId : zonesWithRoads) { - if(visited.find(zoneId) == visited.end()) + if(!vstd::contains(visited, zoneId)) { canRemove = false; break; @@ -1128,7 +1128,7 @@ void CZonePlacer::dropRandomRoads(vstd::RNG * rand) if(!canRemove) { //Restore connection and try next one - if(roadGraph[zoneA].find(zoneB) == roadGraph[zoneA].end()) + if(!vstd::contains(roadGraph[zoneA], zoneB)) { roadGraph[zoneA][zoneB] = 1; roadGraph[zoneB][zoneA] = 1;