Skip to content

Commit e24bcfb

Browse files
[Support] Avoid repeated hash lookups (NFC) (#129827)
1 parent efdd660 commit e24bcfb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llvm/lib/Support/BalancedPartitioning.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,8 @@ void BalancedPartitioning::runIterations(const FunctionNodeRange Nodes,
177177
// functions
178178
for (auto &N : Nodes)
179179
llvm::erase_if(N.UtilityNodes, [&](auto &UN) {
180-
return UtilityNodeIndex[UN] == 1 || UtilityNodeIndex[UN] == NumNodes;
180+
unsigned UNI = UtilityNodeIndex[UN];
181+
return UNI == 1 || UNI == NumNodes;
181182
});
182183

183184
// Renumber utility nodes so they can be used to index into Signatures

0 commit comments

Comments
 (0)