Repository: flex-asjs Updated Branches: refs/heads/tlf 3d2190621 -> 9cc57c4ed
Revert "improve comparisons and move end condition calculation out of loop" This reverts commit 6f03502df36ca0cd01a269db255b2a5c2cbea6f3. Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/9cc57c4e Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/9cc57c4e Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/9cc57c4e Branch: refs/heads/tlf Commit: 9cc57c4ed651d5b2971c78908b324eb2aad4f06a Parents: 3d21906 Author: Harbs <[email protected]> Authored: Thu Jun 22 10:59:28 2017 +0300 Committer: Harbs <[email protected]> Committed: Thu Jun 22 10:59:28 2017 +0300 ---------------------------------------------------------------------- .../org/apache/flex/collections/ArrayList.as | 26 +++++++++----------- .../apache/flex/collections/FlattenedList.as | 15 +++++------ 2 files changed, 17 insertions(+), 24 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9cc57c4e/frameworks/projects/Collections/src/main/flex/org/apache/flex/collections/ArrayList.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Collections/src/main/flex/org/apache/flex/collections/ArrayList.as b/frameworks/projects/Collections/src/main/flex/org/apache/flex/collections/ArrayList.as index 2598dd5..fe74932 100644 --- a/frameworks/projects/Collections/src/main/flex/org/apache/flex/collections/ArrayList.as +++ b/frameworks/projects/Collections/src/main/flex/org/apache/flex/collections/ArrayList.as @@ -93,10 +93,8 @@ package org.apache.flex.collections public function ArrayList(initialSource:Array=null) { super(); - if (initialSource !== null) - _source = initialSource; - else - _source = []; + if (initialSource) _source = initialSource; + else _source = []; } private var _id:String; @@ -119,7 +117,7 @@ package org.apache.flex.collections */ public function set id(value:String):void { - if (_id !== value) + if (_id != value) { _id = value; dispatchEvent(new Event("idChanged")); @@ -159,8 +157,8 @@ package org.apache.flex.collections public function set source(value:Array):void { - if (_source !== value) { - if (value === null) + if (_source != value) { + if (value == null) { _source = []; } @@ -209,10 +207,8 @@ package org.apache.flex.collections */ public function getItemIndex(item:Object):int { - var length:int = _source.length; - - for (var index:int=0; index < length; index++) { - if (item === _source[index]) { + for (var index:int=0; index < _source.length; index++) { + if (item == _source[index]) { return index; } } @@ -248,11 +244,11 @@ package org.apache.flex.collections { source.splice(index, 0, item); } - else if (index === spliceUpperBound) + else if (index == spliceUpperBound) { source.push(item); } - else if (index === 0) + else if (index == 0) { source.unshift(item); } @@ -332,11 +328,11 @@ package org.apache.flex.collections { removed = source.splice(index, 1)[0]; } - else if (index === spliceUpperBound) + else if (index == spliceUpperBound) { removed = source.pop(); } - else if (index === 0) + else if (index == 0) { removed = source.shift(); } http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9cc57c4e/frameworks/projects/Collections/src/main/flex/org/apache/flex/collections/FlattenedList.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Collections/src/main/flex/org/apache/flex/collections/FlattenedList.as b/frameworks/projects/Collections/src/main/flex/org/apache/flex/collections/FlattenedList.as index dba38a5..f26fd8b 100644 --- a/frameworks/projects/Collections/src/main/flex/org/apache/flex/collections/FlattenedList.as +++ b/frameworks/projects/Collections/src/main/flex/org/apache/flex/collections/FlattenedList.as @@ -111,7 +111,7 @@ package org.apache.flex.collections */ public function isOpen(node:Object):Boolean { - return openNodes.indexOf(node) !== -1; + return openNodes.indexOf(node) != -1; } /** @@ -146,7 +146,7 @@ package org.apache.flex.collections public function closeNode(node:Object):void { var i:int = openNodes.indexOf(node); - if (i !== -1) { + if (i != -1) { if (hdata.hasChildren(node)) { var children:Array = hdata.getChildren(node) as Array; @@ -186,16 +186,13 @@ package org.apache.flex.collections */ private function godeep(seeking:Object, node:Object, depth:int):int { - if (seeking === node) - return depth; + if (seeking == node) return depth; if (hdata.hasChildren(node)) { var children:Array = hdata.getChildren(node) as Array; - var length:int = children.length; - for (var i:int=0; i < length; i++) { - var newDepth:int = godeep(seeking, children[i], depth+1); - if (newDepth > 0) - return newDepth; + for (var i:int=0; i < children.length; i++) { + var newDepth:int = godeep(seeking, children[i], depth+1) + if (newDepth > 0) return newDepth; } }
