mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-10 08:27:04 +00:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user