mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-06 16:51:37 +00:00
Improve hashcode in Sectorcoordinates.
This commit is contained in:
@@ -46,11 +46,9 @@ public final class SectorCoordinates {
|
|||||||
if (obj == null || getClass() != obj.getClass()) {
|
if (obj == null || getClass() != obj.getClass()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
final SectorCoordinates other = (SectorCoordinates) obj;
|
final SectorCoordinates other = (SectorCoordinates) obj;
|
||||||
if (x != other.x || y != other.y) {
|
return x == other.x && y == other.y;
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -73,7 +71,7 @@ public final class SectorCoordinates {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return 61 * (427 + x) + y;
|
return x << 16 | y;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user