[downloader] Disputed territory duplication bugfix.

This commit is contained in:
Vladimir Byko-Ianko 2016-05-06 16:32:25 +03:00
parent 1fc801c58e
commit 9926514c14

View file

@ -1198,10 +1198,7 @@ void Storage::GetChildrenInGroups(TCountryId const & parent,
for (auto const & disputed : disputedTerritoriesAndStatus)
allDisputedTerritories.push_back(disputed.first);
if (childStatus.status != NodeStatus::NotDownloaded)
downloadedChildren.push_back(childValue);
if (keepAvailableChildren || childStatus.status == NodeStatus::NotDownloaded)
if (childStatus.status == NodeStatus::NotDownloaded)
{
availChildren.push_back(childValue);
for (auto const & disputed : disputedTerritoriesAndStatus)
@ -1210,6 +1207,12 @@ void Storage::GetChildrenInGroups(TCountryId const & parent,
disputedTerritoriesWithoutSiblings.push_back(disputed.first);
}
}
else
{
downloadedChildren.push_back(childValue);
if (keepAvailableChildren)
availChildren.push_back(childValue);
}
});
TCountriesVec uniqueDisputed(disputedTerritoriesWithoutSiblings.begin(), disputedTerritoriesWithoutSiblings.end());