mapleFU commented on code in PR #2276:
URL: https://github.com/apache/kvrocks/pull/2276#discussion_r1582029700


##########
src/server/server.cc:
##########
@@ -1141,7 +1140,7 @@ void Server::GetCommandsStatsInfo(std::string *info) {
 
     auto latency = cmd_stat.second.latency.load();
     string_stream << "cmdstat_" << cmd_stat.first << ":calls=" << calls << 
",usec=" << latency
-                  << ",usec_per_call=" << ((calls == 0) ? 0 : 
static_cast<float>(latency / calls)) << "\r\n";
+                  << ",usec_per_call=" << static_cast<float>(latency / calls) 
<< "\r\n";

Review Comment:
   calls cannot equal to 0 here, so remove the branch



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to