The hashCode() method now generates a magic prime instead of 0 for the hash of null values; this reduces collisions.

This commit is contained in:
Reinier Zwitserloot committed 2015-06-25 00:13:12 +02:00
1 parent 23dcc9f5a5
commit 251fd03cd7
25 files changed
+49 -44

No files matched your search

@@ -47,7 +47,7 @@ class DataWithGetter {
result = result * PRIME + this.getX();
result = result * PRIME + this.getY();
final java.lang.Object $z = this.getZ();
result = result * PRIME + ($z == null ? 0 : $z.hashCode());
result = result * PRIME + ($z == null ? 43 : $z.hashCode());
return result;
}
@java.lang.Override