Broke out array equals() into its own method.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4661 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -107,6 +107,26 @@ public class ArrayUtil
|
||||
return removeImpl(arr, element, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Do the two arrays contain elements that are all equals()?
|
||||
*/
|
||||
public static function equals (ar1 :Array, ar2 :Array) :Boolean
|
||||
{
|
||||
if (ar1 === ar2) {
|
||||
return true;
|
||||
|
||||
} else if (ar1 == null || ar2 == null || ar1.length != ar2.length) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (var jj :int = 0; jj < ar1.length; jj++) {
|
||||
if (!Util.equals(ar1[jj], ar2[jj])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation of remove methods.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user