From 1e5668c59054d3960b3a6ad811c7b8d502349e80 Mon Sep 17 00:00:00 2001 From: Dmitry Khalanskiy Date: Fri, 22 Mar 2024 16:40:07 +0100 Subject: [PATCH] Remove unused functions --- core/commonJs/src/Instant.kt | 11 ----------- core/jvm/src/Instant.kt | 11 ----------- 2 files changed, 22 deletions(-) diff --git a/core/commonJs/src/Instant.kt b/core/commonJs/src/Instant.kt index 2a7d303e..29f00ef4 100644 --- a/core/commonJs/src/Instant.kt +++ b/core/commonJs/src/Instant.kt @@ -84,17 +84,6 @@ public actual class Instant internal constructor(internal val value: jtInstant) @Deprecated("This overload is only kept for binary compatibility", level = DeprecationLevel.HIDDEN) public fun parse(isoString: String): Instant = parse(input = isoString) - /** A workaround for the string representations of Instant that have an offset of the form - * "+XX" not being recognized by [jtOffsetDateTime.parse], while "+XX:XX" work fine. */ - private fun fixOffsetRepresentation(isoString: String): String { - val time = isoString.indexOf('T', ignoreCase = true) - if (time == -1) return isoString // the string is malformed - val offset = isoString.indexOfLast { c -> c == '+' || c == '-' } - if (offset < time) return isoString // the offset is 'Z' and not +/- something else - val separator = isoString.indexOf(':', offset) // if there is a ':' in the offset, no changes needed - return if (separator != -1) isoString else "$isoString:00" - } - public actual fun fromEpochSeconds(epochSeconds: Long, nanosecondAdjustment: Long): Instant = try { /* Performing normalization here because otherwise this fails: assertEquals((Long.MAX_VALUE % 1_000_000_000).toInt(), diff --git a/core/jvm/src/Instant.kt b/core/jvm/src/Instant.kt index d00dddd4..57351db2 100644 --- a/core/jvm/src/Instant.kt +++ b/core/jvm/src/Instant.kt @@ -83,17 +83,6 @@ public actual class Instant internal constructor(internal val value: jtInstant) @Deprecated("This overload is only kept for binary compatibility", level = DeprecationLevel.HIDDEN) public fun parse(isoString: String): Instant = parse(input = isoString) - /** A workaround for a quirk of the JDKs older than 11 where the string representations of Instant that have an - * offset of the form "+XX" are not recognized by [jtOffsetDateTime.parse], while "+XX:XX" work fine. */ - private fun fixOffsetRepresentation(isoString: CharSequence): CharSequence { - val time = isoString.indexOf('T', ignoreCase = true) - if (time == -1) return isoString // the string is malformed - val offset = isoString.indexOfLast { c -> c == '+' || c == '-' } - if (offset < time) return isoString // the offset is 'Z' and not +/- something else - val separator = isoString.indexOf(':', offset) // if there is a ':' in the offset, no changes needed - return if (separator != -1) isoString else "$isoString:00" - } - public actual fun fromEpochSeconds(epochSeconds: Long, nanosecondAdjustment: Long): Instant = try { Instant(jtInstant.ofEpochSecond(epochSeconds, nanosecondAdjustment)) } catch (e: Exception) {