Replaced a Java 1.5 method call with a 1.4 method call.
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@554 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
@@ -73,13 +73,30 @@ public class AutoFringer
|
|||||||
@Override
|
@Override
|
||||||
public int hashCode ()
|
public int hashCode ()
|
||||||
{
|
{
|
||||||
int result = Arrays.hashCode(_fringeId);
|
int result = arrayHashCode(_fringeId);
|
||||||
if(_passable) {
|
if(_passable) {
|
||||||
result++;
|
result++;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Replaces Arrays.hashCode(long a[]) in AutoFringer.hashCode().
|
||||||
|
* Arrays.hashCode(long a[]) is undefined for Java 1.4, and this is client code.
|
||||||
|
*/
|
||||||
|
protected int arrayHashCode(long a[]) {
|
||||||
|
if (a == null)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
int result = 1;
|
||||||
|
for (long element : a) {
|
||||||
|
int elementHash = (int)(element ^ (element >>> 32));
|
||||||
|
result = 31 * result + elementHash;
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
/** The fringe keys of the tiles that went into this tile in the order they were drawn. */
|
/** The fringe keys of the tiles that went into this tile in the order they were drawn. */
|
||||||
protected long[] _fringeId;
|
protected long[] _fringeId;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user