From d3fb507faa99c45692e47612a1ed3c81380cce37 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Tue, 9 Dec 2025 09:37:49 -0500 Subject: [PATCH] Reducing the need to intern large tags --- .../nip01Core/jackson/TagArrayManualDeserializer.kt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/quartz/src/jvmAndroid/kotlin/com/vitorpamplona/quartz/nip01Core/jackson/TagArrayManualDeserializer.kt b/quartz/src/jvmAndroid/kotlin/com/vitorpamplona/quartz/nip01Core/jackson/TagArrayManualDeserializer.kt index 26468af33f..d7ae3253a4 100644 --- a/quartz/src/jvmAndroid/kotlin/com/vitorpamplona/quartz/nip01Core/jackson/TagArrayManualDeserializer.kt +++ b/quartz/src/jvmAndroid/kotlin/com/vitorpamplona/quartz/nip01Core/jackson/TagArrayManualDeserializer.kt @@ -26,7 +26,15 @@ class TagArrayManualDeserializer { companion object { fun fromJson(jsonObject: JsonNode): Array> = jsonObject.toTypedArray { - it.toTypedArray { s -> if (s.isNull) "" else s.asText().intern() } + it.toTypedArray { s -> + if (s.isNull) { + "" + } else { + val text = s.asText() + if (text.length < 100) text.intern() + text + } + } } } }