From df9a4b21c125c5aee39dfc66e76d307cf32e06c3 Mon Sep 17 00:00:00 2001 From: Harihara Kadayam Date: Mon, 25 Mar 2024 09:31:02 -0700 Subject: [PATCH] Addressed review comments on assignment of variable --- src/proto/proto_mesg_factory.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/proto/proto_mesg_factory.cpp b/src/proto/proto_mesg_factory.cpp index e4b7e17..f16dd3a 100644 --- a/src/proto/proto_mesg_factory.cpp +++ b/src/proto/proto_mesg_factory.cpp @@ -66,16 +66,14 @@ static void log_every_nth(std::string const& addr, ::grpc::Status const& status, static constexpr uint64_t every_nth_sec = 60; std::string msg = addr + "-" + status.error_message(); - uint64_t failed_count = 0; + uint64_t failed_count{1ul}; if (auto const it = t_errors.find(msg); it != t_errors.end()) { if (get_elapsed_time_sec(it->second.second) > every_nth_sec) { - failed_count = 1; it->second = std::pair(1ul, Clock::now()); // Reset } else { failed_count = ++(it->second.first); } } else { - failed_count = 1; t_errors[msg] = std::pair(1ul, Clock::now()); }