Removes the memory counter methods because they are not the best way to measure the size in memory of these objects, since we intern strings all the time.

This commit is contained in:
Vitor Pamplona
2026-01-14 16:49:11 -05:00
parent 3d0b0c01b9
commit 92d4654b20
39 changed files with 20 additions and 263 deletions
@@ -20,9 +20,6 @@
*/
package com.vitorpamplona.quartz.nip01Core.core
import com.vitorpamplona.quartz.utils.bytesUsedInMemory
import com.vitorpamplona.quartz.utils.pointerSizeInBytes
actual data class Address actual constructor(
actual val kind: Kind,
actual val pubKeyHex: HexKey,
@@ -30,12 +27,6 @@ actual data class Address actual constructor(
) : Comparable<Address> {
actual fun toValue() = assemble(kind, pubKeyHex, dTag)
actual fun countMemory(): Int =
3 * pointerSizeInBytes +
8 + // kind
pubKeyHex.bytesUsedInMemory() +
dTag.bytesUsedInMemory()
actual override fun compareTo(other: Address): Int {
val result = kind.compareTo(other.kind)
return if (result == 0) {