mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-16 00:15:01 +00:00
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:
1 parent
23dcc9f5a5
commit
251fd03cd7
25 files changed
+49
-44
No files matched your search
@@ -38,9 +38,9 @@ class EqualsAndHashCode {
|
||||
result = result * PRIME + java.util.Arrays.hashCode(this.y);
|
||||
result = result * PRIME + java.util.Arrays.deepHashCode(this.z);
|
||||
final java.lang.Object $a = this.a;
|
||||
result = result * PRIME + ($a == null ? 0 : $a.hashCode());
|
||||
result = result * PRIME + ($a == null ? 43 : $a.hashCode());
|
||||
final java.lang.Object $b = this.b;
|
||||
result = result * PRIME + ($b == null ? 0 : $b.hashCode());
|
||||
result = result * PRIME + ($b == null ? 43 : $b.hashCode());
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user