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>
141141ProfileSummaryInfo::computeThreshold (int PercentileCutoff) const {
142142 if (!hasProfileSummary ())
143143 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 ;
148147 auto &DetailedSummary = Summary->getDetailedSummary ();
149148 auto &Entry = ProfileSummaryBuilder::getEntryForPercentile (DetailedSummary,
150149 PercentileCutoff);
151150 uint64_t CountThreshold = Entry.MinCount ;
152- ThresholdCache[PercentileCutoff] = CountThreshold;
151+ Iter-> second = CountThreshold;
153152 return CountThreshold;
154153}
155154
You can’t perform that action at this time.
0 commit comments