Skip to content

Commit e509e87

Browse files
[SCF] Avoid repeated hash lookups (NFC) (#108793)
1 parent 0e948bf commit e509e87

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

mlir/lib/Dialect/SCF/IR/SCF.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4084,10 +4084,8 @@ static std::optional<SmallVector<unsigned>> getArgsMapping(ValueRange args1,
40844084
static bool hasDuplicates(ValueRange args) {
40854085
llvm::SmallDenseSet<Value> set;
40864086
for (Value arg : args) {
4087-
if (set.contains(arg))
4087+
if (!set.insert(arg).second)
40884088
return true;
4089-
4090-
set.insert(arg);
40914089
}
40924090
return false;
40934091
}

0 commit comments

Comments
 (0)