Skip to content

Commit e3cfde8

Browse files
bdracobluetoothbot
authored andcommitted
Apply suggestion from @bdraco
1 parent 9569654 commit e3cfde8

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎src/zeroconf/_listener.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,7 @@ def _process_datagram_at_time(
152152
msg = DNSIncoming(data, addr_port, scope, now)
153153
# Move-to-end so a repeat payload refreshes its position and only
154154
# cold entries are evicted when the window is full.
155-
if data in recent_packets:
156-
del recent_packets[data]
155+
recent_packets.pop(data, None)
157156
elif len(recent_packets) >= _RECENT_PACKETS_MAX:
158157
del recent_packets[next(iter(recent_packets))]
159158
recent_packets[data] = (now, msg.has_qu_question())

0 commit comments

Comments
 (0)