From 88ddc51254eaa0e604fe0648604cbfc9b1be6183 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Tue, 25 Jul 2023 14:29:38 +0700 Subject: [PATCH] Wait im stupid --- src/main/kotlin/ru/dbotthepony/mc/otm/data/DecimalCodec.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/data/DecimalCodec.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/data/DecimalCodec.kt index dccd158c9..062564586 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/data/DecimalCodec.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/data/DecimalCodec.kt @@ -35,8 +35,7 @@ object DecimalCodec : Codec { ops.getIntStream(input).flatMap { try { DataResult.success(Pair(Decimal.fromByteArray( - it.mapToObj { val v = it.toLong(); Stream.of(v and 0xFFL, (v and 0xFF00L) ushr 8, (v and 0xFF0000L) ushr 16, (v and 0xFF000000L) ushr 24) } - .flatMap { it } + it .collect(::ByteArrayList, { v, a -> v.add(a.toByte()) }, ByteArrayList::addAll) .toByteArray() ), ops.empty()))