From b41a5f4e5b78aad6744fdabf1e61a3dc8ae849aa Mon Sep 17 00:00:00 2001 From: Albert S Date: Tue, 19 Oct 2021 15:07:10 +0200 Subject: [PATCH] fscache: removePrefix(): use starts_with() --- cache/fscache.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cache/fscache.cpp b/cache/fscache.cpp index 97e8929..a643ca5 100644 --- a/cache/fscache.cpp +++ b/cache/fscache.cpp @@ -46,7 +46,7 @@ void FsCache::removePrefix(std::string_view prefix) // TODO: lock dir for(auto &entry : std::filesystem::directory_iterator(std::filesystem::path{this->path})) { - if(static_cast(entry.path().filename()).find(prefix) == 0) + if(std::string_view(entry.path().filename().c_str()).starts_with(prefix) == 0) { std::filesystem::remove_all(entry); }