Skip to content

Commit

Permalink
Use not in operator
Browse files Browse the repository at this point in the history
This increases readability.
  • Loading branch information
j-t-1 authored Jul 1, 2024
1 parent 7368b0c commit 8f2a82b
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 @@ -3833,7 +3833,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 @@ -5541,7 +5541,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 8f2a82b

Please sign in to comment.