From ff1d2207bd042d41e6e64b0ca019753172f3cfb6 Mon Sep 17 00:00:00 2001 From: Morten Haraldsen Date: Sun, 28 Jan 2024 21:27:53 +0100 Subject: [PATCH] Minor simplification --- .../com/ethlo/time/internal/LimitedCharArrayIntegerUtil.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/ethlo/time/internal/LimitedCharArrayIntegerUtil.java b/src/main/java/com/ethlo/time/internal/LimitedCharArrayIntegerUtil.java index e884d99..d45f550 100644 --- a/src/main/java/com/ethlo/time/internal/LimitedCharArrayIntegerUtil.java +++ b/src/main/java/com/ethlo/time/internal/LimitedCharArrayIntegerUtil.java @@ -62,10 +62,9 @@ public static int parsePositiveInt(final String strNum, int startInclusive, int { ErrorUtil.raiseUnexpectedCharacter(strNum, i); } - result = (result << 1) + (result << 3); - result -= c - ZERO; + result = result * 10 + (c - ZERO); } - return -result; + return result; } public static void toString(final int value, final char[] buf, final int offset, final int charLength)