From 1b585febf99380bff73804d5edc3a2837a68e38a Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Thu, 26 Feb 2009 00:42:26 +0000 Subject: [PATCH] Tighten this up a bit. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5674 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/as/com/threerings/util/ObjectMarshaller.as | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/as/com/threerings/util/ObjectMarshaller.as b/src/as/com/threerings/util/ObjectMarshaller.as index 455e42da3..3d4a7be21 100644 --- a/src/as/com/threerings/util/ObjectMarshaller.as +++ b/src/as/com/threerings/util/ObjectMarshaller.as @@ -66,7 +66,6 @@ public class ObjectMarshaller return dest; } - var bytes :ByteArray = new ByteArray(); bytes.endian = Endian.BIG_ENDIAN; bytes.objectEncoding = ObjectEncoding.AMF3; @@ -125,15 +124,12 @@ public class ObjectMarshaller return dest; } var bytes :ByteArray = (encoded as ByteArray); - // re-set the position in case we're decoding the actual same byte - // array used to encode (and not a network reconstruction) - bytes.position = 0; // Work around dictionary idiocy. Holy shit. See note in encode(). const isDict :Boolean = (bytes[0] === DICTIONARY_MARKER); - if (isDict) { - bytes.position = 1; // advance past our special marker - } + // re-set the position in case we're decoding the actual same byte + // array used to encode (and not a network reconstruction) + bytes.position = isDict ? 1 : 0; bytes.endian = Endian.BIG_ENDIAN; bytes.objectEncoding = ObjectEncoding.AMF3;