From c2c6470f48d49a85fb99a75394ce5f9809814446 Mon Sep 17 00:00:00 2001 From: Abhishek Kaushik Date: Wed, 22 Oct 2025 14:40:57 +0530 Subject: [PATCH] [NFC][SampleFDO] Use const& to avoid copies Use const& in range-based for loop to avoid unnecessary copies --- llvm/include/llvm/ProfileData/SampleProf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/include/llvm/ProfileData/SampleProf.h b/llvm/include/llvm/ProfileData/SampleProf.h index 3dd34aba2d716..05f1b568b0643 100644 --- a/llvm/include/llvm/ProfileData/SampleProf.h +++ b/llvm/include/llvm/ProfileData/SampleProf.h @@ -1072,7 +1072,7 @@ class FunctionSamples { TypeCountMap &TypeCounts = getTypeSamplesAt(Loc); bool Overflowed = false; - for (const auto [Type, Count] : Other) { + for (const auto &[Type, Count] : Other) { FunctionId TypeId(Type); bool RowOverflow = false; TypeCounts[TypeId] = SaturatingMultiplyAdd(