refactor: starts/ends_with changes for clang-tidy 20

This commit is contained in:
fanquake
2025-03-18 08:04:23 +08:00
parent 96a5cd8000
commit 2b85d31bcc
11 changed files with 16 additions and 16 deletions

View File

@@ -624,11 +624,11 @@ void BlockManager::CleanupBlockRevFiles() const
const std::string path = fs::PathToString(it->path().filename());
if (fs::is_regular_file(*it) &&
path.length() == 12 &&
path.substr(8,4) == ".dat")
path.ends_with(".dat"))
{
if (path.substr(0, 3) == "blk") {
if (path.starts_with("blk")) {
mapBlockFiles[path.substr(3, 5)] = it->path();
} else if (path.substr(0, 3) == "rev") {
} else if (path.starts_with("rev")) {
remove(it->path());
}
}