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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user