Skip to content

Commit e8bb235

Browse files
committed
Simplify code to improve readability
1 parent bbae27f commit e8bb235

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

pymysqlreplication/event.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,8 @@ def _verify_event(self):
5858
data = self.packet.read(19 + self.event_size)
5959
footer = self.packet.read(4)
6060
byte_data = zlib.crc32(data).to_bytes(4, byteorder="little")
61-
if byte_data == footer:
62-
self._is_event_valid = True
63-
else:
64-
self._is_event_valid = False
61+
self._is_event_valid = True if byte_data == footer else False
62+
if not self._is_event_valid:
6563
logging.error(
6664
f"An CRC32 has failed for the event type {self.event_type}, "
6765
"indicating a potential integrity issue with the data."

0 commit comments

Comments
 (0)