From 411d2e7df73a687cd98b449514eda0290d9c7112 Mon Sep 17 00:00:00 2001 From: "codeflash-ai[bot]" <148906541+codeflash-ai[bot]@users.noreply.github.com> Date: Fri, 7 Nov 2025 08:11:59 +0000 Subject: [PATCH] Optimize BCDataStream.read_uint16 The optimized code achieves a **36% speedup** by **inlining the `read_uint16` method** and **eliminating the `struct.calcsize()` call**. **Key optimizations:** 1. **Function call elimination**: The original code delegates to `_read_num(' bool: def read_boolean(self) -> bool: return self.read_bytes(1) != b'\x00' def read_int16(self): return self._read_num('