Remove duplicated contains_key test

This commit is contained in:
Jeong YunWon 2019-08-30 01:59:20 +09:00
parent a02ba6104f
commit efecef9d48

View file

@ -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);
} }