commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pascalschumac...@apache.org
Subject [lang] NumberUtils#withDecimalsParsing: Eliminate redundant calculation of isDecimalPoint. (closes #160)
Date Fri, 03 Jun 2016 15:09:00 GMT
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 <eric.wannemacher@cbts.net>
Authored: Fri Jun 3 10:51:47 2016 -0400
Committer: pascalschumacher <pascalschumacher@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) {


Mime
View raw message