Skip to content

Commit 5b5b241

Browse files
[TableGen] Avoid repeated hash lookups (NFC) (llvm#120619)
1 parent 8dfae0c commit 5b5b241

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3290,10 +3290,9 @@ void CodeGenDAGPatterns::ParsePatternFragments(bool OutFrags) {
32903290
if (!OpsList->getArgName(j))
32913291
P->error("Operands list should have names for each operand!");
32923292
StringRef ArgNameStr = OpsList->getArgNameStr(j);
3293-
if (!OperandsSet.count(ArgNameStr))
3293+
if (!OperandsSet.erase(ArgNameStr))
32943294
P->error("'" + ArgNameStr +
32953295
"' does not occur in pattern or was multiply specified!");
3296-
OperandsSet.erase(ArgNameStr);
32973296
Args.push_back(std::string(ArgNameStr));
32983297
}
32993298

0 commit comments

Comments
 (0)