From 831f8e4cfaaa34863cca0ac49457a07c7af23927 Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Tue, 11 Nov 2025 15:55:30 +0100 Subject: [PATCH] Do away with some unnneccesary explicit conversions Signed-off-by: Otto Moerbeek --- pdns/recursordist/nod.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pdns/recursordist/nod.cc b/pdns/recursordist/nod.cc index e50f4ceee4..9f845ad228 100644 --- a/pdns/recursordist/nod.cc +++ b/pdns/recursordist/nod.cc @@ -42,7 +42,7 @@ void PersistentSBF::remove_tmp_files(const filesystem::path& path, std::scoped_l { Regex file_regex(d_prefix + ".*\\." + bf_suffix + "\\..{8}$"); for (const auto& file : filesystem::directory_iterator(path)) { - if (filesystem::is_regular_file(file.path()) && file_regex.match(file.path().filename().c_str())) { + if (filesystem::is_regular_file(file.path()) && file_regex.match(file.path().filename())) { filesystem::remove(file); } } @@ -67,11 +67,11 @@ bool PersistentSBF::init(bool ignore_pid) filesystem::file_time_type newest_time{filesystem::file_time_type::min()}; Regex file_regex(d_prefix + ".*\\." + bf_suffix + "$"); for (const auto& file : filesystem::directory_iterator(path)) { - if (filesystem::is_regular_file(file.path()) && file_regex.match(file.path().filename().c_str())) { + if (filesystem::is_regular_file(file.path()) && file_regex.match(file.path().filename())) { if (ignore_pid || (file.path().filename().string().find(std::to_string(getpid())) == std::string::npos)) { // look for the newest file matching the regex - if (last_write_time(file.path()) > newest_time) { - newest_time = last_write_time(file.path()); + if (file.last_write_time() > newest_time) { + newest_time = file.last_write_time(); newest_file = file.path(); } } @@ -170,7 +170,7 @@ bool PersistentSBF::snapshotCurrent(std::thread::id tid) } } else { - log->info(Logr::Warning, "NODDB snapshot: Cannot write file", "file", Logging::Loggable(file.c_str())); + log->info(Logr::Warning, "NODDB snapshot: Cannot write file", "file", Logging::Loggable(file)); } } return false; -- 2.47.3