Skip to content

Commit

Permalink
Merge pull request crytic#1434 from zhiqiangxu/rm_redundant_get_scope
Browse files Browse the repository at this point in the history
parse_top_level_from_loaded_json: remove redundant get_scope calls
  • Loading branch information
montyly authored Oct 26, 2022
2 parents 841130d 55e5bd2 commit a51544f
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions slither/solc_parsing/slither_compilation_unit_solc.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 257,6 @@ def parse_top_level_from_loaded_json(
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)
Expand All @@ -279,7 278,6 @@ def parse_top_level_from_loaded_json(
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)
Expand All @@ -290,7 288,6 @@ def parse_top_level_from_loaded_json(
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)

Expand Down

0 comments on commit a51544f

Please sign in to comment.