This commit is contained in:
Joel Dice
2012-07-24 11:34:18 -06:00
2 changed files with 28 additions and 1 deletions

View File

@ -43,15 +43,25 @@ public class Arrays {
}
public static int hashCode(Object[] array) {
if(array == null) {
return 9023;
}
int hc = 823347;
for(Object o : array) {
hc += o.hashCode();
hc += o != null ? o.hashCode() : 54267;
hc *= 3;
}
return hc;
}
public static boolean equals(Object[] a, Object[] b) {
if(a == b) {
return true;
}
if(a == null || b == null) {
return false;
}
if(a.length != b.length) {
return false;
}