From 850c2a1a5566d5db965998efe1a601ad4c6c7ef2 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Tue, 13 Feb 2024 14:43:23 +0800 Subject: [PATCH] exporter: initialize member variable in-class for better readability. Signed-off-by: Kefu Chai --- src/exporter/util.cc | 3 +-- src/exporter/util.h | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) 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; -- 2.39.5