diff options
Diffstat (limited to 'kamon-core/src/main/scala/kamon/util')
-rw-r--r-- | kamon-core/src/main/scala/kamon/util/HexCodec.scala | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/kamon-core/src/main/scala/kamon/util/HexCodec.scala b/kamon-core/src/main/scala/kamon/util/HexCodec.scala index d5a9593f..e8807e74 100644 --- a/kamon-core/src/main/scala/kamon/util/HexCodec.scala +++ b/kamon-core/src/main/scala/kamon/util/HexCodec.scala @@ -41,18 +41,16 @@ object HexCodec { var i = index var result = 0L val endIndex = Math.min(index + 16, lowerHex.length) - while ( { - index < endIndex - }) { - val c = lowerHex.charAt(index) + while (i < endIndex) { + val c = lowerHex.charAt(i) result <<= 4 - if (c >= '0' && c <= '9') result |= c - '0' - else if (c >= 'a' && c <= 'f') result |= c - 'a' + 10 + if (c >= '0' && c <= '9') + result |= c - '0' + else if (c >= 'a' && c <= 'f') + result |= c - 'a' + 10 else throw isntLowerHexLong(lowerHex) - { - i = i + 1; index - 1 - } + i += 1 } result } |