]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/store_rebuild.cc
Source Format Enforcement (#763)
[thirdparty/squid.git] / src / store_rebuild.cc
index eb39f3fc445c6511375e7a99d4ffaa5ff7c0480d..d3c38a89b509fac4d25b581b99e1b1422c937612 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1996-2020 The Squid Software Foundation and contributors
+ * Copyright (C) 1996-2021 The Squid Software Foundation and contributors
  *
  * Squid software is distributed under GPLv2+ license and includes
  * contributions from numerous individuals and organizations.
@@ -47,13 +47,6 @@ StoreRebuildData::updateStartTime(const timeval &dirStartTime)
     startTime = started() ? std::min(startTime, dirStartTime) : dirStartTime;
 }
 
-static int
-storeCleanupDoubleCheck(StoreEntry * e)
-{
-    SwapDir *SD = dynamic_cast<SwapDir *>(INDEXSD(e->swap_dirn));
-    return (SD->doubleCheck(*e));
-}
-
 static void
 storeCleanup(void *)
 {
@@ -86,7 +79,7 @@ storeCleanup(void *)
             continue;
 
         if (opt_store_doublecheck)
-            if (storeCleanupDoubleCheck(e))
+            if (e->disk().doubleCheck(*e))
                 ++store_errors;
 
         EBIT_SET(e->flags, ENTRY_VALIDATED);
@@ -244,9 +237,10 @@ void
 Progress::print(std::ostream &os) const
 {
     if (goal > 0) {
+        const auto savedPrecision = os.precision(2);
         const auto percent = 100.0 * completed / goal;
-        os << std::setprecision(2) << percent << "% (" <<
-            completed << " out of " << goal << ")";
+        os << percent << "% (" << completed << " out of " << goal << ")";
+        (void)os.precision(savedPrecision);
     } else if (!completed && !goal) {
         os << "nothing to do";
     } else {