Removed TestClient, checked in a few inconsequential changes.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4337 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -15,16 +15,8 @@ public class ArrayUtil
|
||||
*/
|
||||
public static function sort (arr :Array) :void
|
||||
{
|
||||
// ensure every item is Comparable
|
||||
if (!arr.every(function (item :*, index :int, array :Array) :Boolean
|
||||
{
|
||||
return (item is Comparable);
|
||||
})) {
|
||||
throw new Error("Not all elements are Comparable instances.");
|
||||
}
|
||||
|
||||
arr.sort(function (obj1 :Object, obj2 :Object) :int {
|
||||
return (obj1 as Comparable).compareTo(obj2);
|
||||
return Comparable(obj1).compareTo(obj2);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -16,16 +16,16 @@ import com.threerings.io.TypedArray;
|
||||
public class FlashObjectMarshaller
|
||||
{
|
||||
public static function encode (
|
||||
obj :Object, keepArrays :Boolean = false) :Object
|
||||
obj :Object, encodeArrayElements :Boolean = true) :Object
|
||||
{
|
||||
if (obj == null) {
|
||||
return null;
|
||||
}
|
||||
if (!keepArrays && obj is Array) {
|
||||
if (encodeArrayElements && obj is Array) {
|
||||
var src :Array = (obj as Array);
|
||||
var dest :TypedArray = TypedArray.create(ByteArray);
|
||||
for each (var o :Object in src) {
|
||||
dest.push(encode(o, true));
|
||||
dest.push(encode(o, false));
|
||||
}
|
||||
return dest;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user