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:
Ray Greenwell
2007-04-14 02:59:51 +00:00
parent 773e53ec2d
commit 20e9eb66bd
2 changed files with 21 additions and 11 deletions
+20
View File
@@ -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.
*/