Skip to content

Commit 7417d0a

Browse files
abhishek-kaushik22augusto2112
authored andcommitted
[NFC][SampleFDO] Use const& to avoid copies (llvm#164584)
Use const& in range-based for loop to avoid unnecessary copies
1 parent e805248 commit 7417d0a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/include/llvm/ProfileData/SampleProf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1072,7 +1072,7 @@ class FunctionSamples {
10721072
TypeCountMap &TypeCounts = getTypeSamplesAt(Loc);
10731073
bool Overflowed = false;
10741074

1075-
for (const auto [Type, Count] : Other) {
1075+
for (const auto &[Type, Count] : Other) {
10761076
FunctionId TypeId(Type);
10771077
bool RowOverflow = false;
10781078
TypeCounts[TypeId] = SaturatingMultiplyAdd(

0 commit comments

Comments
 (0)