commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbros...@apache.org
Subject [math] no need for Double allocation just to get hashCode
Date Sun, 29 May 2016 21:45:12 GMT
Repository: commons-math
Updated Branches:
  refs/heads/master 292b6ab08 -> 803e1a6f4


no need for Double allocation just to get hashCode


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

Branch: refs/heads/master
Commit: 803e1a6f4bfcc0ce77cd9b63cf70d264aa8a90ad
Parents: 292b6ab
Author: Dave Brosius <dbrosius@mebigfatguy.com>
Authored: Sun May 29 17:45:02 2016 -0400
Committer: Dave Brosius <dbrosius@mebigfatguy.com>
Committed: Sun May 29 17:45:02 2016 -0400

----------------------------------------------------------------------
 src/main/java/org/apache/commons/math4/util/MathUtils.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-math/blob/803e1a6f/src/main/java/org/apache/commons/math4/util/MathUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/util/MathUtils.java b/src/main/java/org/apache/commons/math4/util/MathUtils.java
index 7f10455..fc3e3fe 100644
--- a/src/main/java/org/apache/commons/math4/util/MathUtils.java
+++ b/src/main/java/org/apache/commons/math4/util/MathUtils.java
@@ -61,7 +61,7 @@ public final class MathUtils {
      * @return the hash code
      */
     public static int hash(double value) {
-        return new Double(value).hashCode();
+        return Double.hashCode(value);
     }
 
     /**


Mime
View raw message