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

Commit

Permalink
perf(watch group): Do not use List.map for tiny lists
Browse files Browse the repository at this point in the history
  • Loading branch information
jbdeboer committed May 29, 2014
1 parent 6062610 commit 61f3348
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/change_detection/watch_group.dart
Original file line number Diff line number Diff line change
Expand Up @@ -235,15 +235,15 @@ class WatchGroup implements _EvalWatchList, _WatchGroupList {
}

// Convert the args from AST to WatchRecords
Iterable<WatchRecord<_Handler>> records = argsAST.map((ast) =>
_cache.putIfAbsent(ast.expression, () => ast.setupWatch(this)));
int i = 0;
records.forEach((WatchRecord<_Handler> record) {
_ArgHandler handler = new _PositionalArgHandler(this, evalWatchRecord, i++);
for (var i = 0; i < argsAST.length; i++) {
var ast = argsAST[i];
WatchRecord<_Handler> record =
_cache.putIfAbsent(ast.expression, () => ast.setupWatch(this));
_ArgHandler handler = new _PositionalArgHandler(this, evalWatchRecord, i);
_ArgHandlerList._add(invokeHandler, handler);
record.handler.addForwardHandler(handler);
handler.acceptValue(record.currentValue);
});
}

namedArgsAST.forEach((Symbol name, AST ast) {
WatchRecord<_Handler> record = _cache.putIfAbsent(ast.expression,
Expand Down

0 comments on commit 61f3348

Please sign in to comment.