flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mamsel...@apache.org
Subject git commit: [flex-sdk] [refs/heads/develop] - FIX FLEX-33853 Optimize UIDUtil/ RPCUIDUtil fromByteArray method
Date Sat, 02 Nov 2013 10:25:34 GMT
Updated Branches:
  refs/heads/develop 2a1212652 -> ce9dc2f6e


FIX FLEX-33853
Optimize UIDUtil/ RPCUIDUtil fromByteArray method


Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/ce9dc2f6
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/ce9dc2f6
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/ce9dc2f6

Branch: refs/heads/develop
Commit: ce9dc2f6e1c4a79efdba308a8f12194975efb24f
Parents: 2a12126
Author: mamsellem <maurice.amsellem@systar.com>
Authored: Sat Nov 2 11:19:37 2013 +0100
Committer: mamsellem <maurice.amsellem@systar.com>
Committed: Sat Nov 2 11:19:37 2013 +0100

----------------------------------------------------------------------
 frameworks/projects/framework/src/mx/utils/UIDUtil.as | 10 +++++-----
 frameworks/projects/rpc/src/mx/utils/RPCUIDUtil.as    | 10 +++++-----
 2 files changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/ce9dc2f6/frameworks/projects/framework/src/mx/utils/UIDUtil.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/framework/src/mx/utils/UIDUtil.as b/frameworks/projects/framework/src/mx/utils/UIDUtil.as
index 116627f..59eeb55 100644
--- a/frameworks/projects/framework/src/mx/utils/UIDUtil.as
+++ b/frameworks/projects/framework/src/mx/utils/UIDUtil.as
@@ -166,18 +166,18 @@ public class UIDUtil
     {
         if (ba != null && ba.length >= 16 && ba.bytesAvailable >= 16)
         {
-            var chars:Array = new Array(36);
+            UIDBuffer.position = 0;
             var index:uint = 0;
             for (var i:uint = 0; i < 16; i++)
             {
                 if (i == 4 || i == 6 || i == 8 || i == 10)
-                    chars[index++] = DASH; // Hyphen char code
+                    UIDBuffer.writeByte(DASH); // Hyphen char code
 
                 var b:int = ba.readByte();
-                chars[index++] = ALPHA_CHAR_CODES[(b & 0xF0) >>> 4];
-                chars[index++] = ALPHA_CHAR_CODES[(b & 0x0F)];
+                UIDBuffer.writeByte(ALPHA_CHAR_CODES[(b & 0xF0) >>> 4]);
+                UIDBuffer.writeByte(ALPHA_CHAR_CODES[(b & 0x0F)]);
             }
-            return String.fromCharCode.apply(null, chars);
+            return UIDBuffer.toString();
         }
 
         return null;

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/ce9dc2f6/frameworks/projects/rpc/src/mx/utils/RPCUIDUtil.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/rpc/src/mx/utils/RPCUIDUtil.as b/frameworks/projects/rpc/src/mx/utils/RPCUIDUtil.as
index 84b4620..65f28a8 100644
--- a/frameworks/projects/rpc/src/mx/utils/RPCUIDUtil.as
+++ b/frameworks/projects/rpc/src/mx/utils/RPCUIDUtil.as
@@ -132,18 +132,18 @@ public class RPCUIDUtil
     {
         if (ba != null && ba.length >= 16 && ba.bytesAvailable >= 16)
         {
-            var chars:Array = new Array(36);
+            UIDBuffer.position = 0;
             var index:uint = 0;
             for (var i:uint = 0; i < 16; i++)
             {
                 if (i == 4 || i == 6 || i == 8 || i == 10)
-                    chars[index++] = DASH; // Hyphen char code
+                    UIDBuffer.writeByte(DASH); // Hyphen char code
 
                 var b:int = ba.readByte();
-                chars[index++] = ALPHA_CHAR_CODES[(b & 0xF0) >>> 4];
-                chars[index++] = ALPHA_CHAR_CODES[(b & 0x0F)];
+                UIDBuffer.writeByte(ALPHA_CHAR_CODES[(b & 0xF0) >>> 4]);
+                UIDBuffer.writeByte(ALPHA_CHAR_CODES[(b & 0x0F)]);
             }
-            return String.fromCharCode.apply(null, chars);
+            return UIDBuffer.toString();
         }
 
         return null;


Mime
View raw message