Merge pull request #1434 from zhiqiangxu/rm_redundant_get_scope

parse_top_level_from_loaded_json: remove redundant get_scope calls
pull/1443/head
Feist Josselin 2 years ago committed by GitHub
commit a51544f3fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      slither/solc_parsing/slither_compilation_unit_solc.py

@ -257,7 +257,6 @@ class SlitherCompilationUnitSolc:
scope.accessible_scopes.append(get_imported_scope)
elif top_level_data[self.get_key()] == "StructDefinition":
scope = self.compilation_unit.get_scope(filename)
st = StructureTopLevel(self.compilation_unit, scope)
st.set_offset(top_level_data["src"], self._compilation_unit)
st_parser = StructureTopLevelSolc(st, top_level_data, self)
@ -279,7 +278,6 @@ class SlitherCompilationUnitSolc:
self._variables_top_level_parser.append(var_parser)
scope.variables[var.name] = var
elif top_level_data[self.get_key()] == "FunctionDefinition":
scope = self.compilation_unit.get_scope(filename)
func = FunctionTopLevel(self._compilation_unit, scope)
scope.functions.add(func)
func.set_offset(top_level_data["src"], self._compilation_unit)
@ -290,7 +288,6 @@ class SlitherCompilationUnitSolc:
self.add_function_or_modifier_parser(func_parser)
elif top_level_data[self.get_key()] == "ErrorDefinition":
scope = self.compilation_unit.get_scope(filename)
custom_error = CustomErrorTopLevel(self._compilation_unit, scope)
custom_error.set_offset(top_level_data["src"], self._compilation_unit)

Loading…
Cancel
Save