From 3363616f56dbf9a2c31467a6056183ee5169fd9d Mon Sep 17 00:00:00 2001 From: elsid Date: Sun, 17 Dec 2023 15:22:00 +0100 Subject: [PATCH] Remove redundant startsWith function --- components/vfs/manager.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/components/vfs/manager.cpp b/components/vfs/manager.cpp index bfc001e4f2..ec8939f5dc 100644 --- a/components/vfs/manager.cpp +++ b/components/vfs/manager.cpp @@ -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) };