]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
exporter: initialize member variable in-class
authorKefu Chai <tchaikov@gmail.com>
Tue, 13 Feb 2024 06:43:23 +0000 (14:43 +0800)
committerKefu Chai <tchaikov@gmail.com>
Tue, 13 Feb 2024 06:44:08 +0000 (14:44 +0800)
for better readability.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
src/exporter/util.cc
src/exporter/util.h

index d6b4ba01ca766ea1f5220c4ff0dd856bb6292b16..451867be277ca193eb3ddf48804e517ea49be5ca 100644 (file)
@@ -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() {
index 9adc128d2b4a8ad6f75d81e64cae3a5c05bb997d..cd5448812e368c58552a2d9ab0a6ccd17b2e010a 100644 (file)
@@ -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;