Skip to content

Commit

Permalink
Adds index for better logging
Browse files Browse the repository at this point in the history
  • Loading branch information
moo24 committed Jul 22, 2024
1 parent fcc1b26 commit b2b395d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions kotlin/src/com/here/flexiblepolyline/FlexiblePolyline.kt
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ object FlexiblePolyline {
require(!(precision < 0 || precision > 15)) { "precision out of range" }
require(!(thirdDimPrecision < 0 || thirdDimPrecision > 15)) { "thirdDimPrecision out of range" }
require(!(thirdDimensionValue < 0 || thirdDimensionValue > 7)) { "thirdDimensionValue out of range" }
val res = (thirdDimPrecision shl 7 or (thirdDimensionValue shl 4) or precision).toLong()
val res = ((thirdDimPrecision shl 7) or (thirdDimensionValue shl 4) or precision).toLong()
Converter.encodeUnsignedVarInt(VERSION, result)
Converter.encodeUnsignedVarInt(res, result)
}
Expand Down Expand Up @@ -248,10 +248,10 @@ object FlexiblePolyline {
var shift: Short = 0
var result: Long = 0

encoded.forEach {
val value = decodeChar(it).toLong()
encoded.withIndex().forEach {
val value = decodeChar(it.value).toLong()
if (value < 0) {
throw IllegalArgumentException("Unexpected value found :: '$it")
throw IllegalArgumentException("Unexpected value found :: '${it.value}' at ${it.index}")
}
result = result or ((value and 0x1FL) shl shift.toInt())
if ((value and 0x20L) == 0L) {
Expand Down

0 comments on commit b2b395d

Please sign in to comment.