Permalink
Browse files

align the structure of hasheq/dohasheq with equiv/pcequiv to avoid de…

…optimization of hash by hotspot

Signed-off-by: Rich Hickey <richhickey@gmail.com>
  • Loading branch information...
cgrand authored and richhickey committed Nov 7, 2012
1 parent d77489d commit 93505932f782f6de94b7b9a06a5b6dfd884c7d8b
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/jvm/clojure/lang/Util.java
@@ -122,10 +122,14 @@ static public int hasheq(Object o){
if(o instanceof Number)
return Numbers.hasheq((Number)o);
else if(o instanceof IHashEq)
- return ((IHashEq)o).hasheq();
+ return dohasheq(o);
return o.hashCode();
}
+public static int dohasheq(Object o) {
+ return ((IHashEq)o).hasheq();
+}
+
static public int hashCombine(int seed, int hash){
//a la boost
seed ^= hash + 0x9e3779b9 + (seed << 6) + (seed >> 2);

0 comments on commit 9350593

Please sign in to comment.