Skip to content

Commit f0afd04

Browse files
committed
Use initializer statements
1 parent 209ea4c commit f0afd04

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

llvm/lib/ProfileData/Coverage/CoverageMapping.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,8 @@ Counter CounterExpressionBuilder::subtract(Counter LHS, Counter RHS,
136136
}
137137

138138
Counter CounterExpressionBuilder::replace(Counter C, const ReplaceMap &Map) {
139-
auto I = Map.find(C);
140-
141139
// Replace C with the value found in Map even if C is Expression.
142-
if (I != Map.end())
140+
if (auto I = Map.find(C); I != Map.end())
143141
return I->second;
144142

145143
if (!C.isExpression())
@@ -161,7 +159,7 @@ Counter CounterExpressionBuilder::replace(Counter C, const ReplaceMap &Map) {
161159
}
162160

163161
// Reconfirm if the reconstructed expression would hit the Map.
164-
if ((I = Map.find(C)) != Map.end())
162+
if (auto I = Map.find(C); I != Map.end())
165163
return I->second;
166164

167165
return C;

0 commit comments

Comments
 (0)