refactor(dns-cache): drop data from DnsCacheRecord

Auto-generated equals/hashCode would compare the ByteArray-list of
addresses by reference identity — a footgun no caller needs. No code
uses ==, copy, componentN, or hashing on records, so the class is now
plain with no synthesized methods.
This commit is contained in:
Claude
2026-05-16 14:30:09 +00:00
parent 424d750aea
commit f0ee1221cb
@@ -342,8 +342,12 @@ class SurgeDns(
* Persistable record. Addresses are stored as raw bytes (4 or 16) so [SurgeDnsStore] can write
* them straight into the binary blob and round-trip through [InetAddress.getByAddress] without
* formatting/parsing a string literal on either side.
*
* Not a `data class`: the auto-generated `equals`/`hashCode` would compare `addresses`
* (List<ByteArray>) by reference identity, which is a footgun. Nothing in this codebase needs
* structural equality on records, so the methods are simply not provided.
*/
data class DnsCacheRecord(
class DnsCacheRecord(
val hostname: String,
val addresses: List<ByteArray>,
val expiresAtMillis: Long,