From 78f0c82680123f146b4e430db46bb2f59b214be1 Mon Sep 17 00:00:00 2001 From: Victor Date: Wed, 26 Feb 2014 08:36:18 +0100 Subject: [PATCH] perf(scope): optim createChild() which always append at the end Closes #626 --- lib/core/scope.dart | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/core/scope.dart b/lib/core/scope.dart index db063051d..3ee9a5878 100644 --- a/lib/core/scope.dart +++ b/lib/core/scope.dart @@ -271,12 +271,11 @@ class Scope { var child = new Scope(childContext, rootScope, this, _readWriteGroup.newGroup(childContext), _readOnlyGroup.newGroup(childContext)); - var next = null; + var prev = _childTail; - child._next = next; child._prev = prev; if (prev == null) _childHead = child; else prev._next = child; - if (next == null) _childTail = child; else next._prev = child; + _childTail = child; return child; } @@ -419,7 +418,7 @@ class RootScope extends Scope { RootScope(Object context, this._astParser, this._parser, GetterCache cacheGetter, FilterMap filterMap, - this._exceptionHandler, this._ttl, this._zone, + this._exceptionHandler, this._ttl, this._zone, this._scopeStats) : super(context, null, null, new RootWatchGroup(new DirtyCheckingChangeDetector(cacheGetter), context),