mirror of
https://github.com/OpenMW/openmw.git
synced 2025-04-01 12:36:40 +00:00
Remove redundant startsWith function
This commit is contained in:
parent
225946b92b
commit
3363616f56
1 changed files with 1 additions and 9 deletions
|
@ -70,21 +70,13 @@ namespace VFS
|
|||
return found->second->getPath();
|
||||
}
|
||||
|
||||
namespace
|
||||
{
|
||||
bool startsWith(std::string_view text, std::string_view start)
|
||||
{
|
||||
return text.rfind(start, 0) == 0;
|
||||
}
|
||||
}
|
||||
|
||||
Manager::RecursiveDirectoryRange Manager::getRecursiveDirectoryIterator(std::string_view path) const
|
||||
{
|
||||
if (path.empty())
|
||||
return { mIndex.begin(), mIndex.end() };
|
||||
std::string normalized = Path::normalizeFilename(path);
|
||||
const auto it = mIndex.lower_bound(normalized);
|
||||
if (it == mIndex.end() || !startsWith(it->first, normalized))
|
||||
if (it == mIndex.end() || !it->first.starts_with(normalized))
|
||||
return { it, it };
|
||||
++normalized.back();
|
||||
return { it, mIndex.lower_bound(normalized) };
|
||||
|
|
Loading…
Reference in a new issue