File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -141,15 +141,14 @@ std::optional<uint64_t>
141
141
ProfileSummaryInfo::computeThreshold (int PercentileCutoff) const {
142
142
if (!hasProfileSummary ())
143
143
return std::nullopt;
144
- auto iter = ThresholdCache.find (PercentileCutoff);
145
- if (iter != ThresholdCache.end ()) {
146
- return iter->second ;
147
- }
144
+ auto [Iter, Inserted] = ThresholdCache.try_emplace (PercentileCutoff);
145
+ if (!Inserted)
146
+ return Iter->second ;
148
147
auto &DetailedSummary = Summary->getDetailedSummary ();
149
148
auto &Entry = ProfileSummaryBuilder::getEntryForPercentile (DetailedSummary,
150
149
PercentileCutoff);
151
150
uint64_t CountThreshold = Entry.MinCount ;
152
- ThresholdCache[PercentileCutoff] = CountThreshold;
151
+ Iter-> second = CountThreshold;
153
152
return CountThreshold;
154
153
}
155
154
You can’t perform that action at this time.
0 commit comments