Skip to content

Commit e3ba478

Browse files
committed
chore: add comment
1 parent b979e46 commit e3ba478

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

src/zeroconf/_cache.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,5 +311,7 @@ def async_mark_unique_records_older_than_1s_to_expire(
311311

312312
def _async_set_created_ttl(self, record: DNSRecord, now: _float, ttl: _float) -> None:
313313
"""Set the created time and ttl of a record."""
314+
# It would be better if we made a copy instead of mutating the record
315+
# in place, but records currently don't have a copy method.
314316
record._set_created_ttl(now, ttl)
315317
self._async_add(record)

src/zeroconf/_dns.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,8 @@ def is_recent(self, now: _float) -> bool:
227227

228228
def _set_created_ttl(self, created: _float, ttl: Union[float, int]) -> None:
229229
"""Set the created and ttl of a record."""
230+
# It would be better if we made a copy instead of mutating the record
231+
# in place, but records currently don't have a copy method.
230232
self.created = created
231233
self.ttl = ttl
232234

0 commit comments

Comments
 (0)