Skip to content

Commit

Permalink
Remove a redundant map access.
Browse files Browse the repository at this point in the history
Change-Id: I37de97f08d37e4de0f413ef5248f9d55e2b168b3
Reviewed-on: https://code-review.googlesource.com/c/re2/+/59490
Reviewed-by: Matthew Fowles Kulukundis <[email protected]>
Reviewed-by: Paul Wankadia <[email protected]>
  • Loading branch information
junyer committed Nov 18, 2021
1 parent 9262284 commit d826d9f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions re2/regexp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -585,8 +585,7 @@ class NamedCapturesWalker : public Regexp::Walker<Ignored> {
// Record first occurrence of each name.
// (The rule is that if you have the same name
// multiple times, only the leftmost one counts.)
if (map_->find(*re->name()) == map_->end())
(*map_)[*re->name()] = re->cap();
map_->insert({*re->name(), re->cap()});
}
return ignored;
}
Expand Down

0 comments on commit d826d9f

Please sign in to comment.