Michael Smith has posted comments on this change. ( http://gerrit.cloudera.org:8080/20494 )
Change subject: IMPALA-12390 (part 4): Enable unnecessary-value-param ...................................................................... Patch Set 3: (8 comments) http://gerrit.cloudera.org:8080/#/c/20494/2/be/src/codegen/codegen-anyval-read-write-info.cc File be/src/codegen/codegen-anyval-read-write-info.cc: http://gerrit.cloudera.org:8080/#/c/20494/2/be/src/codegen/codegen-anyval-read-write-info.cc@145 PS2, Line 145: trin > Couldn't we take it by const reference? Now LlvmCodeGen::CreateBinaryPhiNod Oh yup, I think I looked at this file before CreateBinaryPhiNode. Makes sense for these to be const&. http://gerrit.cloudera.org:8080/#/c/20494/2/be/src/codegen/codegen-anyval-read-write-info.cc@150 PS2, Line 150: trin > Couldn't we take it by const ref if we can do it for CodegenNullPhiNode()? Done http://gerrit.cloudera.org:8080/#/c/20494/2/be/src/rpc/TAcceptQueueServer.cpp File be/src/rpc/TAcceptQueueServer.cpp: http://gerrit.cloudera.org:8080/#/c/20494/2/be/src/rpc/TAcceptQueueServer.cpp@210 PS2, Line 210: const shared_ptr<TTransport>& io_transport, const shared_ptr<TTransport>& client) { > Is there a reason why we don't take 'io_transport' and 'client' as raw poin Private helper method that's simpler to call with shared_ptr. Not really a consistent reason. http://gerrit.cloudera.org:8080/#/c/20494/2/be/src/rpc/authentication.cc File be/src/rpc/authentication.cc: http://gerrit.cloudera.org:8080/#/c/20494/2/be/src/rpc/authentication.cc@627 PS2, Line 627: string > Is it OK if we modify this string? GetUsernameFromBasicAuthHeader() calls T You're right, better to be safe here. I'll have to figure out another way to appease clang-tidy. http://gerrit.cloudera.org:8080/#/c/20494/2/be/src/rpc/authentication.cc@641 PS2, Line 641: > See L627. Done http://gerrit.cloudera.org:8080/#/c/20494/2/be/src/rpc/thrift-thread.cc File be/src/rpc/thrift-thread.cc: http://gerrit.cloudera.org:8080/#/c/20494/2/be/src/rpc/thrift-thread.cc@70 PS2, Line 70: // Passing runnable in to this method (rather than reading from this->runnable()) > This comment indicates that taking by (const) reference may not be correct Based on the Notes at https://en.cppreference.com/w/cpp/utility/functional/bind, I think the std::bind call above saves a copy of the shared_ptr, thereby reference counting it. So I think this comment is incorrect. However I'm comfortable adding a clang-tidy exception if that doesn't seem clear. http://gerrit.cloudera.org:8080/#/c/20494/2/be/src/runtime/io/disk-io-mgr-test.cc File be/src/runtime/io/disk-io-mgr-test.cc: http://gerrit.cloudera.org:8080/#/c/20494/2/be/src/runtime/io/disk-io-mgr-test.cc@720 PS2, Line 720: sub_ranges > InitRange() takes 'sub_ranges' by value and moves it into ScanRange::Reset( sub_ranges is called in a loop, we need to make a copy each call. http://gerrit.cloudera.org:8080/#/c/20494/2/be/src/runtime/io/disk-io-mgr-test.cc@1085 PS2, Line 1085: sub_ranges > See L720, although here we also use 'sub_ranges' on L1097. I'm not sure whe We make multiple copies of sub_ranges in this function: here, and in a loop at L1094. -- To view, visit http://gerrit.cloudera.org:8080/20494 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8aa5d98596d82f615a0a728e0235e7dd9d8b5003 Gerrit-Change-Number: 20494 Gerrit-PatchSet: 3 Gerrit-Owner: Michael Smith <[email protected]> Gerrit-Reviewer: Anonymous Coward <[email protected]> Gerrit-Reviewer: Daniel Becker <[email protected]> Gerrit-Reviewer: Impala Public Jenkins <[email protected]> Gerrit-Reviewer: Joe McDonnell <[email protected]> Gerrit-Reviewer: Michael Smith <[email protected]> Gerrit-Comment-Date: Thu, 21 Sep 2023 18:19:41 +0000 Gerrit-HasComments: Yes
