mirror of
https://github.com/RustPython/Parser.git
synced 2025-07-14 00:25:17 +00:00
Remove duplicated contains_key test
This commit is contained in:
parent
a02ba6104f
commit
efecef9d48
1 changed files with 3 additions and 2 deletions
|
@ -710,7 +710,8 @@ impl SymbolTableBuilder {
|
|||
let location = Default::default();
|
||||
|
||||
// Some checks:
|
||||
if table.symbols.contains_key(name) {
|
||||
let containing = table.symbols.contains_key(name);
|
||||
if containing {
|
||||
// Role already set..
|
||||
match role {
|
||||
SymbolUsage::Global => {
|
||||
|
@ -747,7 +748,7 @@ impl SymbolTableBuilder {
|
|||
}
|
||||
|
||||
// Insert symbol when required:
|
||||
if !table.symbols.contains_key(name) {
|
||||
if !containing {
|
||||
let symbol = Symbol::new(name);
|
||||
table.symbols.insert(name.to_string(), symbol);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue