You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by db...@apache.org on 2016/05/29 21:45:12 UTC

[math] no need for Double allocation just to get hashCode

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 <db...@mebigfatguy.com>
Authored: Sun May 29 17:45:02 2016 -0400
Committer: Dave Brosius <db...@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);
     }
 
     /**