mirror of
https://github.com/octoleo/plantuml.git
synced 2024-11-05 21:17:52 +00:00
Fix poorly distributed hashCode in Position.java
Bitwise shift has lower precedence than addition, so the hashCode calculation was like `(xmin + ymin) << (8 + xmax) << (16 + ymax) << 24` which results in absolutely poor hashCode (in particular, lower 24 bits are always zero).
This commit is contained in:
parent
ab8d4f4118
commit
35f94e2b6d
@ -57,7 +57,7 @@ public class Position {
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return xmin + ymin << 8 + xmax << 16 + ymax << 24;
|
||||
return xmin + (ymin << 8) + (xmax << 16) + (ymax << 24);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user