From: Kefu Chai Date: Tue, 13 Feb 2024 06:43:23 +0000 (+0800) Subject: exporter: initialize member variable in-class X-Git-Tag: testing/wip-batrick-testing-20240411.154038~306^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=850c2a1a5566d5db965998efe1a601ad4c6c7ef2;p=ceph-ci.git exporter: initialize member variable in-class for better readability. Signed-off-by: Kefu Chai --- diff --git a/src/exporter/util.cc b/src/exporter/util.cc index d6b4ba01ca7..451867be277 100644 --- a/src/exporter/util.cc +++ b/src/exporter/util.cc @@ -15,8 +15,7 @@ BlockTimer::BlockTimer(std::string_view file, std::string_view function) : file(file), - function(function), - stopped(false) { + function(function) { t1 = clock_t::now(); } BlockTimer::~BlockTimer() { diff --git a/src/exporter/util.h b/src/exporter/util.h index 9adc128d2b4..cd5448812e3 100644 --- a/src/exporter/util.h +++ b/src/exporter/util.h @@ -11,7 +11,7 @@ class BlockTimer { private: const std::string_view file; const std::string_view function; - bool stopped; + bool stopped = false; using clock_t = std::chrono::steady_clock; clock_t::time_point t1; clock_t::time_point t2;