Alexey Serbin has submitted this change and it was merged. (
http://gerrit.cloudera.org:8080/23057 )
Change subject: [compile] Fix compiler warnings about -Wrange-loop-construct
......................................................................
[compile] Fix compiler warnings about -Wrange-loop-construct
This commit resolves multiple instances of the
`-Wrange-loop-construct` warning across various tests.
These warnings occur when using `const std::string&` as
a loop variable to iterate over a brace-enclosed initializer
list of string literals (`const char*`).
The warnings were of the form:
warning: loop variable '...' of type 'const string&' binds
to a temporary constructed from type 'const char* const'
[-Wrange-loop-construct]
To address this:
- Use of `std::string_view`.
- Use of `const std::string` directly in loop.
- Support for `std::string_view` in `SubstituteArg`.
This change eliminates warnings while maintaining safe and
readable code, and avoids unnecessary string copies when not
needed.
Change-Id: I32a9a043e7aade2c2c879472c13cbf2641daa7f3
Reviewed-on: http://gerrit.cloudera.org:8080/23057
Reviewed-by: Alexey Serbin <[email protected]>
Tested-by: Alexey Serbin <[email protected]>
---
M src/kudu/consensus/quorum_util-test.cc
M src/kudu/gutil/strings/substitute.h
M src/kudu/tools/kudu-tool-test.cc
M src/kudu/tserver/tablet_server-test.cc
4 files changed, 13 insertions(+), 7 deletions(-)
Approvals:
Alexey Serbin: Looks good to me, approved; Verified
--
To view, visit http://gerrit.cloudera.org:8080/23057
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I32a9a043e7aade2c2c879472c13cbf2641daa7f3
Gerrit-Change-Number: 23057
Gerrit-PatchSet: 6
Gerrit-Owner: KeDeng <[email protected]>
Gerrit-Reviewer: Alexey Serbin <[email protected]>
Gerrit-Reviewer: KeDeng <[email protected]>
Gerrit-Reviewer: Kudu Jenkins (120)