gavinchou commented on code in PR #52729:
URL: https://github.com/apache/doris/pull/52729#discussion_r2182333192


##########
cloud/src/meta-store/mem_txn_kv.cpp:
##########
@@ -349,6 +355,9 @@ TxnErrorCode Transaction::inner_get(const std::string& 
begin, const std::string&
     std::vector<std::pair<std::string, std::string>> kv_list(kv_map.begin(), 
kv_map.end());
     num_get_keys_ += kv_list.size();
     kv_->get_count_ += kv_list.size();
+    get_bytes_ += std::accumulate(kv_list.begin(), kv_list.end(), 0, [](auto 
init, auto it) {

Review Comment:
   for loop seems more straightforward/readable, e.g. 
   ```
   for (auto& [k, v] : kv_list) get_bytes_ += k.size() + v.size();
   ```
   
   use simple way in stead of lambda if LOC is not reduced significantly



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to