mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-17 06:14:58 +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
@@ -93,7 +93,7 @@ class AccessorsChain {
|
||||
final int PRIME = 59;
|
||||
int result = 1;
|
||||
final java.lang.Object $fName = this.getName();
|
||||
result = ((result * PRIME) + (($fName == null) ? 0 : $fName.hashCode()));
|
||||
result = ((result * PRIME) + (($fName == null) ? 43 : $fName.hashCode()));
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user