Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/23057 )
Change subject: [compile] Fix compiler warnings about -Wrange-loop-construct ...................................................................... Patch Set 4: (2 comments) http://gerrit.cloudera.org:8080/#/c/23057/4/src/kudu/consensus/quorum_util-test.cc File src/kudu/consensus/quorum_util-test.cc: http://gerrit.cloudera.org:8080/#/c/23057/4/src/kudu/consensus/quorum_util-test.cc@1523 PS4, Line 1523: for (const auto* const leader_replica : { "A", "B", "C", "D", "E", "F" }) { : string to_evict; : ASSERT_TRUE(ShouldEvictReplica(config, leader_replica, 3, &to_evict)); : EXPECT_TRUE(to_evict == "A" || to_evict == "B" || to_evict == "C"); : string leader(leader_replica); nit: if it's necessary to create an instance of std::string anyway, a more concise form might be for (const string leader_replica : { "A", "B", "C", "D", "E", "F" }) { ... } http://gerrit.cloudera.org:8080/#/c/23057/4/src/kudu/tserver/tablet_server-test.cc File src/kudu/tserver/tablet_server-test.cc: http://gerrit.cloudera.org:8080/#/c/23057/4/src/kudu/tserver/tablet_server-test.cc@5011 PS4, Line 5011: for (const auto* other_cstr : { "", "bad-guy" }) { : string other(other_cstr); // safe conversion from const char* nit: if creating an instance of std::string is necessary, then more concise (i.e. one-line) form might be: for (const string other : { "", "bad-guy" }) ... -- 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: comment Gerrit-Change-Id: I32a9a043e7aade2c2c879472c13cbf2641daa7f3 Gerrit-Change-Number: 23057 Gerrit-PatchSet: 4 Gerrit-Owner: KeDeng <[email protected]> Gerrit-Reviewer: Alexey Serbin <[email protected]> Gerrit-Reviewer: KeDeng <[email protected]> Gerrit-Reviewer: Kudu Jenkins (120) Gerrit-Comment-Date: Fri, 11 Jul 2025 21:05:53 +0000 Gerrit-HasComments: Yes
