Skip to content

Commit cd2909e

Browse files
authored
NFC: fix range loop analysis warning. (#38747)
Silence warning by using reference type (`&`) to avoid creating a copy.
1 parent af8759a commit cd2909e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/IRGen/GenProto.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3538,7 +3538,7 @@ llvm::Constant *IRGenModule::getAddrOfGenericEnvironment(
35383538
llvm::SmallVector<uint16_t, 4> genericParamCounts;
35393539
unsigned curDepth = 0;
35403540
unsigned genericParamCount = 0;
3541-
for (const auto gp : signature.getGenericParams()) {
3541+
for (const auto &gp : signature.getGenericParams()) {
35423542
if (curDepth != gp->getDepth()) {
35433543
genericParamCounts.push_back(genericParamCount);
35443544
curDepth = gp->getDepth();

0 commit comments

Comments
 (0)