]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Do away with some unnneccesary explicit conversions 16296/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Tue, 11 Nov 2025 14:55:30 +0000 (15:55 +0100)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Tue, 2 Jun 2026 13:40:58 +0000 (15:40 +0200)
Signed-off-by: Otto Moerbeek <otto.moerbeek@open-xchange.com>
pdns/recursordist/nod.cc

index e50f4ceee43ceb53a30b819891eaa176f0148ffb..9f845ad228ac4b4e159ef9300f648f158006f0a1 100644 (file)
@@ -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;