Skip to content

Commit 09c6c20

Browse files
committed
fix: docstring
1 parent 6d69ad8 commit 09c6c20

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

src/zeroconf/_protocol/outgoing.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -224,10 +224,8 @@ def _write_byte(self, value: int_) -> None:
224224
self.size += 1
225225

226226
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)
227+
"""Convert an unsigned short to 2 bytes."""
228+
return SHORT_LOOKUP[value] if value < SHORT_CACHE_MAX else PACK_SHORT(value)
231229

232230
def _insert_short_at_start(self, value: int_) -> None:
233231
"""Inserts an unsigned short at the start of the packet"""

0 commit comments

Comments
 (0)