We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5406f30 commit 1492e41Copy full SHA for 1492e41
1 file changed
src/zeroconf/_services/info.py
@@ -361,20 +361,11 @@ def _unpack_text_into_properties(self) -> None:
361
strs.append(text[index : index + length])
362
index += length
363
364
- key: bytes
365
- value: Optional[bytes]
366
for s in strs:
367
- key_value = s.split(b'=', 1)
368
- if len(key_value) == 2:
369
- key, value = key_value
370
- else:
371
- # No equals sign at all
372
- key = s
373
- value = None
374
-
+ key, _, value = s.partition(b'=')
375
# Only update non-existent properties
376
if key and key not in result:
377
- result[key] = value
+ result[key] = value or None
378
379
# Properties should be set atomically
380
# in case another thread is reading them
0 commit comments