mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-30 22:45:34 +00:00
Merge branch 'UseFindInsteadOfLoop' into 'master'
Use O(log(n)) search instead of O(n) See merge request OpenMW/openmw!824
This commit is contained in:
commit
6446a48f91
1 changed files with 1 additions and 6 deletions
|
@ -55,12 +55,7 @@ namespace VFS
|
||||||
|
|
||||||
bool FileSystemArchive::contains(const std::string& file, char (*normalize_function)(char)) const
|
bool FileSystemArchive::contains(const std::string& file, char (*normalize_function)(char)) const
|
||||||
{
|
{
|
||||||
for (const auto& it : mIndex)
|
return mIndex.find(file) != mIndex.end();
|
||||||
{
|
|
||||||
if(it.first == file)
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string FileSystemArchive::getDescription() const
|
std::string FileSystemArchive::getDescription() const
|
||||||
|
|
Loading…
Reference in a new issue