diff --git a/storage/storage.hpp b/storage/storage.hpp index 271bfcf90c..ab92cfd12f 100644 --- a/storage/storage.hpp +++ b/storage/storage.hpp @@ -637,7 +637,7 @@ void Storage::ForEachAncestorExceptForTheRoot(TCountryId const & countryId, ToDo template void Storage::ForEachAncestorExceptForTheRoot(vector const & nodes, ToDo && toDo) const { - TCountriesSet visitedAncestors; + set visitedAncestors; // In most cases nodes.size() == 1. In case of disputable territories nodes.size() // may be more than one. It means |childId| is present in the country tree more than once. for (auto const & node : nodes) @@ -646,10 +646,10 @@ void Storage::ForEachAncestorExceptForTheRoot(vector c [&](TCountryTreeNode const & container) { TCountryId const ancestorId = container.Value().Name(); - if (visitedAncestors.find(ancestorId) != visitedAncestors.end()) + if (visitedAncestors.find(&container) != visitedAncestors.end()) return; // The node was visited before because countryId is present in the tree more // than once. - visitedAncestors.insert(ancestorId); + visitedAncestors.insert(&container); toDo(ancestorId, container); }); }