Skip to content

Commit b3be105

Browse files
ttsugriyfacebook-github-bot
authored andcommitted
Create statDefs in-place.
Summary: not a big deal, but no need to copy defs if they can be created in-place Reviewed By: dmm-fb Differential Revision: D75710904 fbshipit-source-id: 9c9986f5db522092aa8f3c70bce0643f2dbe6824
1 parent 22c7c55 commit b3be105

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

fb303/ServiceData.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -238,15 +238,13 @@ std::shared_ptr<QuantileStat> ServiceData::getQuantileStat(
238238
std::vector<detail::QuantileStatMap::StatDef> statDefs;
239239
statDefs.reserve(stats.size() + quantiles.size());
240240
for (auto statType : stats) {
241-
detail::QuantileStatMap::StatDef statDef;
241+
auto& statDef = statDefs.emplace_back();
242242
statDef.type = statType;
243-
statDefs.push_back(statDef);
244243
}
245244
for (auto quantile : quantiles) {
246-
detail::QuantileStatMap::StatDef statDef;
245+
auto& statDef = statDefs.emplace_back();
247246
statDef.type = ExportType::PERCENT;
248247
statDef.quantile = quantile;
249-
statDefs.push_back(statDef);
250248
}
251249

252250
return quantileMap_.registerQuantileStat(

0 commit comments

Comments
 (0)