From 4b07f971688d8120ebb7890d33e3304e22ec48d8 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Sun, 11 Feb 2024 12:06:03 +0700 Subject: [PATCH] fix int.tosignedvar --- gradle.properties | 2 +- src/main/kotlin/ru/dbotthepony/kommons/io/OutputStreamUtils.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index f0830cd..30fcabd 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,7 +4,7 @@ kotlin.code.style=official specifyKotlinAsDependency=false projectGroup=ru.dbotthepony.kommons -projectVersion=2.1.6 +projectVersion=2.1.7 guavaDepVersion=33.0.0 gsonDepVersion=2.8.9 diff --git a/src/main/kotlin/ru/dbotthepony/kommons/io/OutputStreamUtils.kt b/src/main/kotlin/ru/dbotthepony/kommons/io/OutputStreamUtils.kt index b6cea04..b7dbb14 100644 --- a/src/main/kotlin/ru/dbotthepony/kommons/io/OutputStreamUtils.kt +++ b/src/main/kotlin/ru/dbotthepony/kommons/io/OutputStreamUtils.kt @@ -109,7 +109,7 @@ private fun Int.toSignedVar(): Int { if (this >= 0) return this shl 1 else - return (this shl 1) or 1 + return ((-this - 1) shl 1) or 1 } private fun Long.toSignedVar(): Long {