Skip to content

Commit f0d9d35

Browse files
authored
Apply suggestion from @bdraco
1 parent 2a4303e commit f0d9d35

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)