File tree Expand file tree Collapse file tree
kotlin/src/com/here/flexiblepolyline Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -115,7 +115,7 @@ object FlexiblePolyline {
115115 require(! (precision < 0 || precision > 15 )) { " precision out of range" }
116116 require(! (thirdDimPrecision < 0 || thirdDimPrecision > 15 )) { " thirdDimPrecision out of range" }
117117 require(! (thirdDimensionValue < 0 || thirdDimensionValue > 7 )) { " thirdDimensionValue out of range" }
118- val res = (thirdDimPrecision shl 7 or (thirdDimensionValue shl 4 ) or precision).toLong()
118+ val res = (( thirdDimPrecision shl 7 ) or (thirdDimensionValue shl 4 ) or precision).toLong()
119119 Converter .encodeUnsignedVarInt(VERSION , result)
120120 Converter .encodeUnsignedVarInt(res, result)
121121 }
@@ -248,10 +248,10 @@ object FlexiblePolyline {
248248 var shift: Short = 0
249249 var result: Long = 0
250250
251- encoded.forEach {
252- val value = decodeChar(it).toLong()
251+ encoded.withIndex(). forEach {
252+ val value = decodeChar(it.value ).toLong()
253253 if (value < 0 ) {
254- throw IllegalArgumentException (" Unexpected value found :: '$it " )
254+ throw IllegalArgumentException (" Unexpected value found :: '${it.value} ' at ${it.index} " )
255255 }
256256 result = result or ((value and 0x1FL ) shl shift.toInt())
257257 if ((value and 0x20L ) == 0L ) {
You can’t perform that action at this time.
0 commit comments