You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by jm...@apache.org on 2013/10/18 06:49:03 UTC

[1/2] git commit: [flex-sdk] [refs/heads/develop] - fix usage messages

Updated Branches:
  refs/heads/develop 75bd4e352 -> 3f93971c7


fix usage messages


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

Branch: refs/heads/develop
Commit: 0a418bdeb1574100fca6ef5ef5b088313dcc0bad
Parents: 75bd4e3
Author: Justin Mclean <jm...@apache.org>
Authored: Fri Oct 18 15:45:38 2013 +1100
Committer: Justin Mclean <jm...@apache.org>
Committed: Fri Oct 18 15:45:38 2013 +1100

----------------------------------------------------------------------
 build/deploy_release_candidate.sh | 2 +-
 build/tag_release_candidate.sh    | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/0a418bde/build/deploy_release_candidate.sh
----------------------------------------------------------------------
diff --git a/build/deploy_release_candidate.sh b/build/deploy_release_candidate.sh
index 60a7bfb..8dcf01b 100755
--- a/build/deploy_release_candidate.sh
+++ b/build/deploy_release_candidate.sh
@@ -22,7 +22,7 @@
 
 if [ $# -ne 2 ]
 then
-    echo "Usage: deploy_release_branch flex_version ([0-99].[0-99].[0-999]) release_candidate ([0-100])"
+    echo "Usage: deploy_release_candidate flex_version ([0-99].[0-99].[0-999]) release_candidate ([0-100])"
 fi
 
 FLEX_VERSION="$1"

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/0a418bde/build/tag_release_candidate.sh
----------------------------------------------------------------------
diff --git a/build/tag_release_candidate.sh b/build/tag_release_candidate.sh
index 345bc68..ba825ac 100755
--- a/build/tag_release_candidate.sh
+++ b/build/tag_release_candidate.sh
@@ -22,7 +22,7 @@
 
 if [ $# -ne 2 ]
 then
-    echo "Usage: deploy_release_branch flex_version ([0-99].[0-99].[0-999]) release_candidate ([0-100])"
+    echo "Usage: tag_release_candidate flex_version ([0-99].[0-99].[0-999]) release_candidate ([0-100])"
 fi
 
 FLEX_VERSION="$1"
@@ -44,4 +44,4 @@ then
 fi
 
 git tag -a apache-flex-sdk-${FLEX_VERSION}RC${RELEASE_CANDIDATE} -m \'"Apache Flex ${FLEX_VERSION} RC${RELEASE_CANDIDATE}"\'
-git push --tags
\ No newline at end of file
+git push --tags


[2/2] git commit: [flex-sdk] [refs/heads/develop] - FLEX-33829 improve create UID performance and use

Posted by jm...@apache.org.
FLEX-33829 improve create UID performance and use


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

Branch: refs/heads/develop
Commit: 3f93971c7fdde96dea0aacc3617728534976f13a
Parents: 0a418bd
Author: Justin Mclean <jm...@apache.org>
Authored: Fri Oct 18 15:47:00 2013 +1100
Committer: Justin Mclean <jm...@apache.org>
Committed: Fri Oct 18 15:47:00 2013 +1100

----------------------------------------------------------------------
 .../org/apache/flex/collections/ArrayList.as    |   4 +-
 .../org/apache/flex/collections/VectorList.as   |   4 +-
 .../framework/src/mx/collections/ArrayList.as   |   4 +-
 .../projects/framework/src/mx/utils/UIDUtil.as  | 108 ++++++++++---------
 4 files changed, 68 insertions(+), 52 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/3f93971c/frameworks/projects/apache/src/org/apache/flex/collections/ArrayList.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/apache/src/org/apache/flex/collections/ArrayList.as b/frameworks/projects/apache/src/org/apache/flex/collections/ArrayList.as
index 3cce583..93b821a 100644
--- a/frameworks/projects/apache/src/org/apache/flex/collections/ArrayList.as
+++ b/frameworks/projects/apache/src/org/apache/flex/collections/ArrayList.as
@@ -120,7 +120,6 @@ public class ArrayList extends EventDispatcher
         disableEvents();
         this.source = source;
         enableEvents();
-        _uid = UIDUtil.createUID();
     }
     
     //--------------------------------------------------------------------------
@@ -257,6 +256,9 @@ public class ArrayList extends EventDispatcher
      */  
     public function get uid():String
     {
+		if (!_uid) {
+			_uid = UIDUtil.createUID();
+		}
         return _uid;
     }
     

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/3f93971c/frameworks/projects/apache/src/org/apache/flex/collections/VectorList.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/apache/src/org/apache/flex/collections/VectorList.as b/frameworks/projects/apache/src/org/apache/flex/collections/VectorList.as
index 3d47c8c..5892935 100644
--- a/frameworks/projects/apache/src/org/apache/flex/collections/VectorList.as
+++ b/frameworks/projects/apache/src/org/apache/flex/collections/VectorList.as
@@ -110,7 +110,6 @@ public class VectorList extends EventDispatcher
         disableEvents();
         this.source = source;
         enableEvents();
-        _uid = UIDUtil.createUID();
     }
 
     /**
@@ -214,6 +213,9 @@ public class VectorList extends EventDispatcher
      */  
     public function get uid():String
     {
+		if (!_uid) {
+			_uid = UIDUtil.createUID();
+		}
         return _uid;
     }
     

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/3f93971c/frameworks/projects/framework/src/mx/collections/ArrayList.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/framework/src/mx/collections/ArrayList.as b/frameworks/projects/framework/src/mx/collections/ArrayList.as
index b207d42..1afa845 100644
--- a/frameworks/projects/framework/src/mx/collections/ArrayList.as
+++ b/frameworks/projects/framework/src/mx/collections/ArrayList.as
@@ -118,7 +118,6 @@ public class ArrayList extends EventDispatcher
         disableEvents();
         this.source = source;
         enableEvents();
-        _uid = UIDUtil.createUID();
     }
     
     //--------------------------------------------------------------------------
@@ -255,6 +254,9 @@ public class ArrayList extends EventDispatcher
      */  
     public function get uid():String
     {
+		if (!_uid) {
+			_uid = UIDUtil.createUID();
+		}
         return _uid;
     }
     

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/3f93971c/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 4993563..20186e0 100644
--- a/frameworks/projects/framework/src/mx/utils/UIDUtil.as
+++ b/frameworks/projects/framework/src/mx/utils/UIDUtil.as
@@ -63,8 +63,18 @@ public class UIDUtil
      *  @private
      *  Char codes for 0123456789ABCDEF
      */
-    private static const ALPHA_CHAR_CODES:Array = [48, 49, 50, 51, 52, 53, 54, 
-        55, 56, 57, 65, 66, 67, 68, 69, 70];
+	private static const ALPHA_CHAR_CODES:Array = [48, 49, 50, 51, 52, 53, 54, 
+		55, 56, 57, 65, 66, 67, 68, 69, 70];
+	
+	private static const HEX_CHARS:String = "0123456789ABCDEF";
+	
+	private static var EMPTYUID:Array = [
+		'0','0','0','0','0','0','0','0',
+		'-','0','0','0','0',
+		'-','0','0','0','0',
+		'-','0','0','0','0',
+		'0','0','0','0','0','0','0','0','0','0','0','0'
+	];
 
     //--------------------------------------------------------------------------
     //
@@ -106,53 +116,53 @@ public class UIDUtil
      *  @playerversion AIR 1.1
      *  @productversion Flex 3
      */
-    public static function createUID():String
-    {
-        var uid:Array = new Array(36);
-        var index:int = 0;
-        
-        var i:int;
-        var j:int;
-        
-        for (i = 0; i < 8; i++)
-        {
-            uid[index++] = ALPHA_CHAR_CODES[Math.floor(Math.random() *  16)];
-        }
-
-        for (i = 0; i < 3; i++)
-        {
-            uid[index++] = 45; // charCode for "-"
-            
-            for (j = 0; j < 4; j++)
-            {
-                uid[index++] = ALPHA_CHAR_CODES[Math.floor(Math.random() *  16)];
-            }
-        }
-        
-        uid[index++] = 45; // charCode for "-"
-
-        var time:Number = new Date().getTime();
-        // Note: time is the number of milliseconds since 1970,
-        // which is currently more than one trillion.
-        // We use the low 8 hex digits of this number in the UID.
-        // Just in case the system clock has been reset to
-        // Jan 1-4, 1970 (in which case this number could have only
-        // 1-7 hex digits), we pad on the left with 7 zeros
-        // before taking the low digits.
-        var timeString:String = ("0000000" + time.toString(16).toUpperCase()).substr(-8);
-        
-        for (i = 0; i < 8; i++)
-        {
-            uid[index++] = timeString.charCodeAt(i);
-        }
-        
-        for (i = 0; i < 4; i++)
-        {
-            uid[index++] = ALPHA_CHAR_CODES[Math.floor(Math.random() *  16)];
-        }
-        
-        return String.fromCharCode.apply(null, uid);
-    }
+	public static function createUID():String
+	{
+		var uid:Array = EMPTYUID;
+		var index:int = 0;
+		
+		var i:int;
+		var j:int;
+		
+		for (i = 0; i < 8; i++)
+		{
+			uid[index++] = HEX_CHARS.charAt(Math.random() * 16);
+		}
+		
+		for (i = 0; i < 3; i++)
+		{
+			index++; // skip "-"
+			
+			for (j = 0; j < 4; j++)
+			{
+				uid[index++] = HEX_CHARS.charAt(Math.random() * 16);
+			}
+		}
+		
+		index++; // skip "-"
+		
+		var time:Number = new Date().getTime();
+		// Note: time is the number of milliseconds since 1970,
+		// which is currently more than one trillion.
+		// We use the low 8 hex digits of this number in the UID.
+		// Just in case the system clock has been reset to
+		// Jan 1-4, 1970 (in which case this number could have only
+		// 1-7 hex digits), we pad on the left with 7 zeros
+		// before taking the low digits.
+		var timeString:String = ("0000000" + time.toString(16).toUpperCase()).substr(-8);
+		
+		for (i = 0; i < 8; i++)
+		{
+			uid[index++] = timeString.charAt(i);
+		}
+		
+		for (i = 0; i < 4; i++)
+		{
+			uid[index++] = HEX_CHARS.charAt(Math.random() * 16);
+		}
+		
+		return uid.join("");
+	}
 
     /**
      * Converts a 128-bit UID encoded as a ByteArray to a String representation.