Skip to content

Commit

Permalink
Use chaining comparison operators
Browse files Browse the repository at this point in the history
Increases readability.
  • Loading branch information
j-t-1 authored Jul 2, 2024
1 parent 7368b0c commit 0b81748
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pefile.py
Original file line number Diff line number Diff line change
Expand Up @@ -7837,9 +7837,7 @@ def get_overlay_data_start_offset(self):
def update_if_sum_is_larger_and_within_file(
offset_and_size, file_size=len(self.__data__)
):
if sum(offset_and_size) <= file_size and sum(offset_and_size) > sum(
largest_offset_and_size
):
if sum(largest_offset_and_size) < sum(offset_and_size) <= file_size:
return offset_and_size
return largest_offset_and_size

Expand Down

0 comments on commit 0b81748

Please sign in to comment.