Skip to content

Commit

Permalink
Merge pull request #2 from quarkslab/fix
Browse files Browse the repository at this point in the history
Rename private variable to avoid shadowing
  • Loading branch information
RobinDavid committed Aug 28, 2023
2 parents a7a167e + fd4c7a0 commit 17f1e79
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions bindiff/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ def __init__(self, file: Union[Path, str], permission: str = "ro"):
self._load_metadata(self.db.cursor())

# Files
self.primary: File = None #: Primary file
self.secondary: File = None #: Secondary file
self.primary_file: File = None #: Primary file
self.secondary_file: File = None #: Secondary file
self._load_file(self.db.cursor())

# Function matches
Expand All @@ -108,14 +108,14 @@ def unmatched_primary_count(self) -> int:
"""
Returns the number of functions inside primary that are not matched
"""
return self.primary.functions + self.primary.libfunctions - len(self.primary_functions_match)
return self.primary_file.functions + self.primary_file.libfunctions - len(self.primary_functions_match)

@property
def unmatched_secondary_count(self) -> int:
"""
Returns the number of functions inside secondary that are not matched
"""
return self.secondary.functions + self.secondary.libfunctions - len(self.primary_functions_match)
return self.secondary_file.functions + self.secondary_file.libfunctions - len(self.primary_functions_match)

@property
def function_matches(self) -> list[FunctionMatch]:
Expand All @@ -138,8 +138,8 @@ def _load_file(self, cursor: sqlite3.Cursor) -> None:
:param cursor: sqlite3 cursor to the DB
"""
query = "SELECT * FROM file"
self.primary = File(*cursor.execute(query).fetchone())
self.secondary = File(*cursor.execute(query).fetchone())
self.primary_file = File(*cursor.execute(query).fetchone())
self.secondary_file = File(*cursor.execute(query).fetchone())

def _load_metadata(self, cursor: sqlite3.Cursor) -> None:
"""
Expand Down

0 comments on commit 17f1e79

Please sign in to comment.