From faeaa303b903139f36c15751c8e48ef982222842 Mon Sep 17 00:00:00 2001 From: Eric Wannemacher Date: Fri, 3 Jun 2016 10:51:47 -0400 Subject: [PATCH] NumberUtils#withDecimalsParsing: Eliminate redundant calculation of isDecimalPoint. (closes #160) --- src/main/java/org/apache/commons/lang3/math/NumberUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/apache/commons/lang3/math/NumberUtils.java b/src/main/java/org/apache/commons/lang3/math/NumberUtils.java index d602524c3..22dddf46b 100644 --- a/src/main/java/org/apache/commons/lang3/math/NumberUtils.java +++ b/src/main/java/org/apache/commons/lang3/math/NumberUtils.java @@ -1524,7 +1524,7 @@ public class NumberUtils { int decimalPoints = 0; for (int i = beginIdx; i < str.length(); i++) { final boolean isDecimalPoint = str.charAt(i) == '.'; - if (str.charAt(i) == '.') { + if (isDecimalPoint) { decimalPoints++; } if (decimalPoints > 1) {