Skip to content

Commit

Permalink
Remove pointless check. (#1382)
Browse files Browse the repository at this point in the history
The container is an `unordered_set`, which means we can insert without
causing duplication. Hence, we can avoid the find code.
  • Loading branch information
1uc committed Aug 5, 2024
1 parent f18b9d1 commit de969a3
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/codegen/codegen_helper_visitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -772,11 +772,9 @@ void CodegenHelperVisitor::visit_verbatim(const Verbatim& node) {

// check if the token exist in the symbol table
for (auto& token: tokens) {
if (info.variables_in_verbatim.find(token) == info.variables_in_verbatim.end()) {
auto symbol = psymtab->lookup(token);
if (symbol != nullptr) {
info.variables_in_verbatim.insert(token);
}
auto symbol = psymtab->lookup(token);
if (symbol != nullptr) {
info.variables_in_verbatim.insert(token);
}
}
}
Expand Down

0 comments on commit de969a3

Please sign in to comment.