Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Side by Side Diff: pkg/scheduled_test/lib/src/schedule.dart

Issue 12401002: Make List.from and Iterable.toList default to not growable. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/pathos/lib/path.dart ('k') | pkg/serialization/lib/src/serialization_helpers.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library schedule; 5 library schedule;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 9
10 import 'package:unittest/unittest.dart' as unittest; 10 import 'package:unittest/unittest.dart' as unittest;
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 /// Returns a detailed representation of the queue as a tree of tasks. If 464 /// Returns a detailed representation of the queue as a tree of tasks. If
465 /// [highlight] is passed, that task is specially highlighted. 465 /// [highlight] is passed, that task is specially highlighted.
466 /// 466 ///
467 /// [highlight] must be a task in this queue. 467 /// [highlight] must be a task in this queue.
468 String generateTree([Task highlight]) { 468 String generateTree([Task highlight]) {
469 assert(highlight == null || highlight.queue == this); 469 assert(highlight == null || highlight.queue == this);
470 return _contents.map((task) { 470 return _contents.map((task) {
471 var lines = task.toString().split("\n"); 471 var lines = task.toString().split("\n");
472 var firstLine = task == highlight ? 472 var firstLine = task == highlight ?
473 "> ${lines.first}" : "* ${lines.first}"; 473 "> ${lines.first}" : "* ${lines.first}";
474 lines = [firstLine]..addAll(lines.skip(1).map((line) => "| $line")); 474 lines = new List.from(lines.skip(1).map((line) => "| $line"));
475 lines.insertRange(0, 1, firstLine);
475 return lines.join("\n"); 476 return lines.join("\n");
476 }).join("\n"); 477 }).join("\n");
477 } 478 }
478 } 479 }
OLDNEW
« no previous file with comments | « pkg/pathos/lib/path.dart ('k') | pkg/serialization/lib/src/serialization_helpers.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698