Skip to content

Commit 4f6fabd

Browse files
[Driver] Avoid repeated map lookups (NFC) (#122625)
1 parent 5e4b41c commit 4f6fabd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clang/lib/Driver/Driver.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2534,8 +2534,8 @@ enum {
25342534
static unsigned PrintActions1(const Compilation &C, Action *A,
25352535
std::map<Action *, unsigned> &Ids,
25362536
Twine Indent = {}, int Kind = TopLevelAction) {
2537-
if (Ids.count(A)) // A was already visited.
2538-
return Ids[A];
2537+
if (auto It = Ids.find(A); It != Ids.end()) // A was already visited.
2538+
return It->second;
25392539

25402540
std::string str;
25412541
llvm::raw_string_ostream os(str);

0 commit comments

Comments
 (0)