From: Remi Gacogne Date: Thu, 15 Apr 2021 09:55:03 +0000 (+0200) Subject: Real in-place construction in histogram X-Git-Tag: dnsdist-1.6.0~3^2^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0c2e35c205ed0caa56cc4b06e9796ed0b8cf3268;p=thirdparty%2Fpdns.git Real in-place construction in histogram --- diff --git a/pdns/histogram.hh b/pdns/histogram.hh index ef14f9f8fd..9584536f0b 100644 --- a/pdns/histogram.hh +++ b/pdns/histogram.hh @@ -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::max(), 0}); + d_buckets.emplace_back(prefix + "le-max", std::numeric_limits::max(), 0); } const std::vector& 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; }