This is an automated email from the ASF dual-hosted git repository.

alexey pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git

commit 2392bf72a0abc0cb02b0e67633e29f69be3baf2f
Author: Alexey Serbin <[email protected]>
AuthorDate: Fri Feb 4 20:35:27 2022 -0800

    [tablet] fix compilation warning in rowset_info.cc
    
    src/kudu/tablet/rowset_info.cc:207:21: warning: loop variable 'col_id' of 
type 'const kudu::ColumnId' creates a copy from type 'const kudu::ColumnId' 
[-Wrange-loop-analysis]
        for (const auto col_id : col_ids) {
                        ^
    src/kudu/tablet/rowset_info.cc:207:10: note: use reference type 'const 
kudu::ColumnId &' to prevent copying
        for (const auto col_id : col_ids) {
             ^~~~~~~~~~~~~~~~~~~
                        &
    
    Change-Id: I25379f9764d7c6c6699740a06877301b624c1f54
    Reviewed-on: http://gerrit.cloudera.org:8080/18202
    Reviewed-by: Andrew Wong <[email protected]>
    Tested-by: Alexey Serbin <[email protected]>
---
 src/kudu/tablet/rowset_info.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/kudu/tablet/rowset_info.cc b/src/kudu/tablet/rowset_info.cc
index 069dde5..37d2016 100644
--- a/src/kudu/tablet/rowset_info.cc
+++ b/src/kudu/tablet/rowset_info.cc
@@ -204,7 +204,7 @@ double WidthByDataSize(const Slice& prev, const Slice& next,
 
   for (const auto& rs_rsi : active) {
     double fraction = StringFractionInRange(rs_rsi.second, prev, next);
-    for (const auto col_id : col_ids) {
+    for (const auto& col_id : col_ids) {
       weight += rs_rsi.second->size_bytes(col_id) * fraction;
     }
   }

Reply via email to