Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

Commit 78f0c82

Browse files
vicbmhevery
authored andcommitted
perf(scope): optim createChild() which always append at the end
Closes #626
1 parent 107e80d commit 78f0c82

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/core/scope.dart

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -271,12 +271,11 @@ class Scope {
271271
var child = new Scope(childContext, rootScope, this,
272272
_readWriteGroup.newGroup(childContext),
273273
_readOnlyGroup.newGroup(childContext));
274-
var next = null;
274+
275275
var prev = _childTail;
276-
child._next = next;
277276
child._prev = prev;
278277
if (prev == null) _childHead = child; else prev._next = child;
279-
if (next == null) _childTail = child; else next._prev = child;
278+
_childTail = child;
280279
return child;
281280
}
282281

@@ -419,7 +418,7 @@ class RootScope extends Scope {
419418

420419
RootScope(Object context, this._astParser, this._parser,
421420
GetterCache cacheGetter, FilterMap filterMap,
422-
this._exceptionHandler, this._ttl, this._zone,
421+
this._exceptionHandler, this._ttl, this._zone,
423422
this._scopeStats)
424423
: super(context, null, null,
425424
new RootWatchGroup(new DirtyCheckingChangeDetector(cacheGetter), context),

0 commit comments

Comments
 (0)