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
@@ -23,8 +23,6 @@ package com.vitorpamplona.quartz.nip01Core.core
import android.os.Parcel
import android.os.Parcelable
import androidx.compose.runtime.Stable
import com.vitorpamplona.quartz.utils.bytesUsedInMemory
import com.vitorpamplona.quartz.utils.pointerSizeInBytes
@Stable
actual data class Address actual constructor(
@@ -35,12 +33,6 @@ actual data class Address actual constructor(
Parcelable {
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 kindComparison = kind.compareTo(other.kind)
return if (kindComparison == 0) {