Skip to content

Commit a71cd5a

Browse files
generatedunixname89002005287564meta-codesync[bot]
authored andcommitted
Fix CQS signal modernize-use-emplace in fbcode/katran/lib
Differential Revision: D88941001 fbshipit-source-id: f592347e71304a57976c45c074d2d8c30f458555
1 parent f4a0f05 commit a71cd5a

3 files changed

Lines changed: 20 additions & 20 deletions

File tree

katran/lib/KatranLb.cpp

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -245,23 +245,23 @@ void KatranLb::initialSanityChecking(bool flowDebug, bool globalLru) {
245245

246246
std::vector<std::string> maps;
247247

248-
maps.push_back(KatranLbMaps::ctl_array);
249-
maps.push_back(KatranLbMaps::vip_map);
250-
maps.push_back(KatranLbMaps::ch_rings);
251-
maps.push_back(KatranLbMaps::reals);
252-
maps.push_back(KatranLbMaps::stats);
253-
maps.push_back(KatranLbMaps::lru_mapping);
254-
maps.push_back(KatranLbMaps::server_id_map);
255-
maps.push_back(KatranLbMaps::lru_miss_stats);
256-
maps.push_back(KatranLbMaps::vip_miss_stats);
257-
maps.push_back(KatranLbMaps::vip_to_down_reals_map);
248+
maps.emplace_back(KatranLbMaps::ctl_array);
249+
maps.emplace_back(KatranLbMaps::vip_map);
250+
maps.emplace_back(KatranLbMaps::ch_rings);
251+
maps.emplace_back(KatranLbMaps::reals);
252+
maps.emplace_back(KatranLbMaps::stats);
253+
maps.emplace_back(KatranLbMaps::lru_mapping);
254+
maps.emplace_back(KatranLbMaps::server_id_map);
255+
maps.emplace_back(KatranLbMaps::lru_miss_stats);
256+
maps.emplace_back(KatranLbMaps::vip_miss_stats);
257+
maps.emplace_back(KatranLbMaps::vip_to_down_reals_map);
258258

259259
if (flowDebug) {
260-
maps.push_back(KatranLbMaps::flow_debug_maps);
260+
maps.emplace_back(KatranLbMaps::flow_debug_maps);
261261
}
262262

263263
if (globalLru) {
264-
maps.push_back(KatranLbMaps::global_lru_maps);
264+
maps.emplace_back(KatranLbMaps::global_lru_maps);
265265
}
266266

267267
res = getKatranProgFd();
@@ -282,9 +282,9 @@ void KatranLb::initialSanityChecking(bool flowDebug, bool globalLru) {
282282
kHealthcheckerProgName,
283283
folly::errnoStr(errno)));
284284
}
285-
maps.push_back(KatranLbMaps::hc_ctrl_map);
286-
maps.push_back(KatranLbMaps::hc_reals_map);
287-
maps.push_back(KatranLbMaps::hc_stats_map);
285+
maps.emplace_back(KatranLbMaps::hc_ctrl_map);
286+
maps.emplace_back(KatranLbMaps::hc_reals_map);
287+
maps.emplace_back(KatranLbMaps::hc_stats_map);
288288
}
289289

290290
// some sanity checking. we will check that all maps exists, so in later
@@ -2816,7 +2816,7 @@ std::vector<std::string> KatranLb::deleteLru(
28162816
if (fallbackMapFd > 0) {
28172817
int res = bpfAdapter_->bpfMapDeleteElement(fallbackMapFd, &key);
28182818
if (res == 0) {
2819-
mapsWithDeletions.push_back("fallback");
2819+
mapsWithDeletions.emplace_back("fallback");
28202820
} else {
28212821
if (errno != ENOENT) {
28222822
// ENOENT is expected in case there is no entry in the lru map

katran/lib/tests/KatranLbTest.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -438,8 +438,8 @@ TEST_F(KatranLbTest, addFewInvalidNets) {
438438
auto prefix = fmt::format("10.0.{}.0/24", i);
439439
srcs.push_back(prefix);
440440
}
441-
srcs.push_back("aaa");
442-
srcs.push_back("bbb");
441+
srcs.emplace_back("aaa");
442+
srcs.emplace_back("bbb");
443443
auto res = lb->addSrcRoutingRule(srcs, "fc00::1");
444444
ASSERT_EQ(res, 2);
445445
ASSERT_EQ(lb->getSrcRoutingRuleSize(), 7);

katran/lib/tests/MonitoringServiceCoreTest.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ TEST_F(TestMonitoringServiceCore, RacingClients) {
138138
std::vector<std::thread> threads;
139139
folly::Synchronized<std::vector<uint32_t>> cids;
140140
for (int i = 0; i < 30; i++) {
141-
threads.push_back(std::thread([&]() mutable {
141+
threads.emplace_back([&]() mutable {
142142
ClientId cid;
143143
if (folly::Random::rand32() % 2 == 0) {
144144
auto res = core->acceptSubscription(group1EventIds);
@@ -157,7 +157,7 @@ TEST_F(TestMonitoringServiceCore, RacingClients) {
157157
}
158158
auto cids_ = cids.wlock();
159159
cids_->push_back(cid);
160-
}));
160+
});
161161
}
162162
for (int i = 0; i < 30; i++) {
163163
threads[i].join();

0 commit comments

Comments
 (0)