Skip to content

Commit

Permalink
Simplify code to improve readability
Browse files Browse the repository at this point in the history
  • Loading branch information
why-arong committed Oct 19, 2023
1 parent bbae27f commit e8bb235
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions pymysqlreplication/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,8 @@ def _verify_event(self):
data = self.packet.read(19 + self.event_size)
footer = self.packet.read(4)
byte_data = zlib.crc32(data).to_bytes(4, byteorder="little")
if byte_data == footer:
self._is_event_valid = True
else:
self._is_event_valid = False
self._is_event_valid = True if byte_data == footer else False
if not self._is_event_valid:
logging.error(
f"An CRC32 has failed for the event type {self.event_type}, "
"indicating a potential integrity issue with the data."
Expand Down

0 comments on commit e8bb235

Please sign in to comment.