mirror of
https://github.com/RustPython/Parser.git
synced 2025-07-16 17:45:24 +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();
|
let location = Default::default();
|
||||||
|
|
||||||
// Some checks:
|
// Some checks:
|
||||||
if table.symbols.contains_key(name) {
|
let containing = table.symbols.contains_key(name);
|
||||||
|
if containing {
|
||||||
// Role already set..
|
// Role already set..
|
||||||
match role {
|
match role {
|
||||||
SymbolUsage::Global => {
|
SymbolUsage::Global => {
|
||||||
|
@ -747,7 +748,7 @@ impl SymbolTableBuilder {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Insert symbol when required:
|
// Insert symbol when required:
|
||||||
if !table.symbols.contains_key(name) {
|
if !containing {
|
||||||
let symbol = Symbol::new(name);
|
let symbol = Symbol::new(name);
|
||||||
table.symbols.insert(name.to_string(), symbol);
|
table.symbols.insert(name.to_string(), symbol);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue