Fixed invalid sort/unique usage

This commit is contained in:
Alex Zolotarev 2011-11-16 21:57:17 +03:00 committed by Alex Zolotarev
parent eb58f4e521
commit 0dc4bf42ce
2 changed files with 2 additions and 2 deletions

View file

@ -153,8 +153,8 @@ void Framework<TModel>::GetLocalMaps(vector<string> & outMaps)
Platform & pl = GetPlatform();
pl.GetFilesInDir(pl.ResourcesDir(), "*" DATA_FILE_EXTENSION, outMaps);
pl.GetFilesInDir(pl.WritableDir(), "*" DATA_FILE_EXTENSION, outMaps);
outMaps.resize(unique(outMaps.begin(), outMaps.end()) - outMaps.begin());
sort(outMaps.begin(), outMaps.end());
outMaps.erase(unique(outMaps.begin(), outMaps.end()), outMaps.end());
}
template <typename TModel>

View file

@ -52,8 +52,8 @@ void Platform::GetFontNames(FilesList & res) const
{
GetFilesInDir(ResourcesDir(), "*.ttf", res);
GetFilesInDir(WritableDir(), "*.ttf", res);
res.resize(unique(res.begin(), res.end()) - res.begin());
sort(res.begin(), res.end());
res.erase(unique(res.begin(), res.end()), res.end());
CHECK(!res.empty(), ("Can't find any valid font in", ResourcesDir(), WritableDir()));
}