We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6d69ad8 commit 09c6c20Copy full SHA for 09c6c20
1 file changed
src/zeroconf/_protocol/outgoing.py
@@ -224,10 +224,8 @@ def _write_byte(self, value: int_) -> None:
224
self.size += 1
225
226
def _get_short(self, value: int_) -> bytes:
227
- """Gets an unsigned short from a certain position in the packet"""
228
- if value < SHORT_CACHE_MAX:
229
- return SHORT_LOOKUP[value]
230
- return PACK_SHORT(value)
+ """Convert an unsigned short to 2 bytes."""
+ return SHORT_LOOKUP[value] if value < SHORT_CACHE_MAX else PACK_SHORT(value)
231
232
def _insert_short_at_start(self, value: int_) -> None:
233
"""Inserts an unsigned short at the start of the packet"""
0 commit comments