mirror of
https://github.com/tiennm99/lombok.git
synced 2026-05-27 22:26:17 +00:00
Issue 625: use (even) better primes for hashcodes
This commit is contained in:
@@ -24,7 +24,7 @@ public class EqualsAndHashCodeExample {
|
||||
}
|
||||
|
||||
@Override public int hashCode() {
|
||||
final int PRIME = 277;
|
||||
final int PRIME = 59;
|
||||
int result = 1;
|
||||
final long temp1 = Double.doubleToLongBits(this.score);
|
||||
result = (result*PRIME) + (this.name == null ? 0 : this.name.hashCode());
|
||||
@@ -57,7 +57,7 @@ public class EqualsAndHashCodeExample {
|
||||
}
|
||||
|
||||
@Override public int hashCode() {
|
||||
final int PRIME = 277;
|
||||
final int PRIME = 59;
|
||||
int result = 1;
|
||||
result = (result*PRIME) + super.hashCode();
|
||||
result = (result*PRIME) + this.width;
|
||||
|
||||
Reference in New Issue
Block a user