You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by pa...@apache.org on 2016/06/03 15:09:00 UTC

[lang] NumberUtils#withDecimalsParsing: Eliminate redundant calculation of isDecimalPoint. (closes #160)

Repository: commons-lang
Updated Branches:
  refs/heads/master c979d6393 -> faeaa303b


NumberUtils#withDecimalsParsing: Eliminate redundant calculation of isDecimalPoint. (closes #160)


Project: http://git-wip-us.apache.org/repos/asf/commons-lang/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-lang/commit/faeaa303
Tree: http://git-wip-us.apache.org/repos/asf/commons-lang/tree/faeaa303
Diff: http://git-wip-us.apache.org/repos/asf/commons-lang/diff/faeaa303

Branch: refs/heads/master
Commit: faeaa303b903139f36c15751c8e48ef982222842
Parents: c979d63
Author: Eric Wannemacher <er...@cbts.net>
Authored: Fri Jun 3 10:51:47 2016 -0400
Committer: pascalschumacher <pa...@gmx.net>
Committed: Fri Jun 3 17:07:40 2016 +0200

----------------------------------------------------------------------
 src/main/java/org/apache/commons/lang3/math/NumberUtils.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-lang/blob/faeaa303/src/main/java/org/apache/commons/lang3/math/NumberUtils.java
----------------------------------------------------------------------
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 d602524..22dddf4 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) {