]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Real in-place construction in histogram
authorRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 15 Apr 2021 09:55:03 +0000 (11:55 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 15 Apr 2021 10:04:26 +0000 (12:04 +0200)
pdns/histogram.hh

index ef14f9f8fd06f32b74d1af8106231a1b1ab87a43..9584536f0b6dc03d3aa2dc171273757669202d6d 100644 (file)
@@ -74,11 +74,11 @@ public:
         throw std::invalid_argument("boundary array's elements should be distinct");
       }
       std::string str = prefix + "le-" + std::to_string(b);
-      d_buckets.emplace_back(B{str, b, 0});
+      d_buckets.emplace_back(str, b, 0);
       prev = b;
     }
     // everything above last boundary
-    d_buckets.emplace_back(B{prefix + "le-max", std::numeric_limits<uint64_t>::max(), 0});
+    d_buckets.emplace_back(prefix + "le-max", std::numeric_limits<uint64_t>::max(), 0);
   }
 
   const std::vector<B>& getRawData() const
@@ -98,7 +98,7 @@ public:
     uint64_t c{0};
     for (const auto& b : d_buckets) {
       c += b.d_count;
-      ret.emplace_back(B{b.d_name, b.d_boundary, c});
+      ret.emplace_back(b.d_name, b.d_boundary, c);
     }
     return ret;
   }