From 0b81748aa00f65e33295210aff9cda09893f615f Mon Sep 17 00:00:00 2001 From: j-t-1 <120829237+j-t-1@users.noreply.github.com> Date: Tue, 2 Jul 2024 09:24:09 +0100 Subject: [PATCH] Use chaining comparison operators Increases readability. --- pefile.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pefile.py b/pefile.py index cd8cc6e..d892a7d 100644 --- a/pefile.py +++ b/pefile.py @@ -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