Skip to content

Commit

Permalink
Merge pull request #414 from j-t-1/refactor
Browse files Browse the repository at this point in the history
Use not in operator
  • Loading branch information
erocarrera authored Aug 26, 2024
2 parents 37c75e5 + 8f2a82b commit 0a2eb88
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pefile.py
Original file line number Diff line number Diff line change
Expand Up @@ -1375,7 +1375,7 @@ def get_bits_left(self):
ac = Accumulator(old_fmt, comp_fields)

for elm in format[1]:
if not ":" in elm:
if ":" not in elm:
ac.wrap_up()
old_fmt.append(elm)
continue
Expand All @@ -1400,7 +1400,7 @@ def get_bits_left(self):

extended_keys = []
for idx, val in enumerate(keys):
if not idx in comp_fields:
if idx not in comp_fields:
extended_keys.append(val)
continue
_, sbf = comp_fields[idx]
Expand Down Expand Up @@ -3831,7 +3831,7 @@ def parse_exceptions_directory(self, rva, size):
continue
if not hasattr(rf.unwindinfo, "FunctionEntry"):
continue
if not rf.unwindinfo.FunctionEntry in rva2rt:
if rf.unwindinfo.FunctionEntry not in rva2rt:
self.__warnings.append(
f"FunctionEntry of UNWIND_INFO at {rf.struct.get_file_offset():x}"
" points to an entry that does not exist"
Expand Down Expand Up @@ -5539,7 +5539,7 @@ def length_until_eof(rva):
symbol_counts = collections.defaultdict(int)
export_parsing_loop_completed_normally = True
for idx in range(min(export_dir.NumberOfFunctions, int(safety_boundary / 4))):
if not idx + export_dir.Base in ordinals:
if idx + export_dir.Base not in ordinals:
try:
symbol_address = self.get_dword_from_data(address_of_functions, idx)
except PEFormatError:
Expand Down

0 comments on commit 0a2eb88

Please sign in to comment.