Skip to content

Commit a9cc7fe

Browse files
[NFC][SampleFDO] Use const& to avoid copies (#164584)
Use const& in range-based for loop to avoid unnecessary copies
1 parent f6712b6 commit a9cc7fe

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)