Skip to content

Commit 1e5668c

Browse files
committed
Remove unused functions
1 parent b07ef03 commit 1e5668c

File tree

2 files changed

+0
-22
lines changed

2 files changed

+0
-22
lines changed

core/commonJs/src/Instant.kt

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -84,17 +84,6 @@ public actual class Instant internal constructor(internal val value: jtInstant)
8484
@Deprecated("This overload is only kept for binary compatibility", level = DeprecationLevel.HIDDEN)
8585
public fun parse(isoString: String): Instant = parse(input = isoString)
8686

87-
/** A workaround for the string representations of Instant that have an offset of the form
88-
* "+XX" not being recognized by [jtOffsetDateTime.parse], while "+XX:XX" work fine. */
89-
private fun fixOffsetRepresentation(isoString: String): String {
90-
val time = isoString.indexOf('T', ignoreCase = true)
91-
if (time == -1) return isoString // the string is malformed
92-
val offset = isoString.indexOfLast { c -> c == '+' || c == '-' }
93-
if (offset < time) return isoString // the offset is 'Z' and not +/- something else
94-
val separator = isoString.indexOf(':', offset) // if there is a ':' in the offset, no changes needed
95-
return if (separator != -1) isoString else "$isoString:00"
96-
}
97-
9887
public actual fun fromEpochSeconds(epochSeconds: Long, nanosecondAdjustment: Long): Instant = try {
9988
/* Performing normalization here because otherwise this fails:
10089
assertEquals((Long.MAX_VALUE % 1_000_000_000).toInt(),

core/jvm/src/Instant.kt

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -83,17 +83,6 @@ public actual class Instant internal constructor(internal val value: jtInstant)
8383
@Deprecated("This overload is only kept for binary compatibility", level = DeprecationLevel.HIDDEN)
8484
public fun parse(isoString: String): Instant = parse(input = isoString)
8585

86-
/** A workaround for a quirk of the JDKs older than 11 where the string representations of Instant that have an
87-
* offset of the form "+XX" are not recognized by [jtOffsetDateTime.parse], while "+XX:XX" work fine. */
88-
private fun fixOffsetRepresentation(isoString: CharSequence): CharSequence {
89-
val time = isoString.indexOf('T', ignoreCase = true)
90-
if (time == -1) return isoString // the string is malformed
91-
val offset = isoString.indexOfLast { c -> c == '+' || c == '-' }
92-
if (offset < time) return isoString // the offset is 'Z' and not +/- something else
93-
val separator = isoString.indexOf(':', offset) // if there is a ':' in the offset, no changes needed
94-
return if (separator != -1) isoString else "$isoString:00"
95-
}
96-
9786
public actual fun fromEpochSeconds(epochSeconds: Long, nanosecondAdjustment: Long): Instant = try {
9887
Instant(jtInstant.ofEpochSecond(epochSeconds, nanosecondAdjustment))
9988
} catch (e: Exception) {

0 commit comments

Comments
 (0)