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

Side by Side Diff: sdk/lib/html/templates/immutable_list_mixin.darttemplate

Issue 11412086: Make 'where' lazy. (Closed) Base URL: https://dart.googlecode.com/svn/experimental/lib_v2/dart
Patch Set: FilteredIterable/Iterator -> WhereIterable/Iterator. Created 8 years, 1 month 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
OLDNEW
1 // -- start List<$E> mixins. 1 // -- start List<$E> mixins.
2 // $E is the element type. 2 // $E is the element type.
3 3
4 // From Iterable<$E>: 4 // From Iterable<$E>:
5 5
6 Iterator<$E> get iterator { 6 Iterator<$E> get iterator {
7 // Note: NodeLists are not fixed size. And most probably length shouldn't 7 // Note: NodeLists are not fixed size. And most probably length shouldn't
8 // be cached in both iterator _and_ forEach method. For now caching it 8 // be cached in both iterator _and_ forEach method. For now caching it
9 // for consistency. 9 // for consistency.
10 return new FixedSizeListIterator<$E>(this); 10 return new FixedSizeListIterator<$E>(this);
(...skipping 17 matching lines...) Expand all
28 bool contains($E element) => _Collections.contains(this, element); 28 bool contains($E element) => _Collections.contains(this, element);
29 $else 29 $else
30 // contains() defined by IDL. 30 // contains() defined by IDL.
31 $endif 31 $endif
32 32
33 void forEach(void f($E element)) => _Collections.forEach(this, f); 33 void forEach(void f($E element)) => _Collections.forEach(this, f);
34 34
35 Iterable mappedBy(f($E element)) => 35 Iterable mappedBy(f($E element)) =>
36 new MappedIterable<$E, dynamic>(this, f); 36 new MappedIterable<$E, dynamic>(this, f);
37 37
38 Collection<$E> where(bool f($E element)) => 38 Iterable<$E> where(bool f($E element)) => new WhereIterable<$E>(this, f);
39 _Collections.where(this, <$E>[], f);
40 39
41 bool every(bool f($E element)) => _Collections.every(this, f); 40 bool every(bool f($E element)) => _Collections.every(this, f);
42 41
43 bool some(bool f($E element)) => _Collections.some(this, f); 42 bool some(bool f($E element)) => _Collections.some(this, f);
44 43
45 bool get isEmpty => this.length == 0; 44 bool get isEmpty => this.length == 0;
46 45
47 // From List<$E>: 46 // From List<$E>:
48 47
49 void sort([Comparator<$E> compare = Comparable.compare]) { 48 void sort([Comparator<$E> compare = Comparable.compare]) {
(...skipping 23 matching lines...) Expand all
73 } 72 }
74 73
75 void insertRange(int start, int rangeLength, [$E initialValue]) { 74 void insertRange(int start, int rangeLength, [$E initialValue]) {
76 throw new UnsupportedError("Cannot insertRange on immutable List."); 75 throw new UnsupportedError("Cannot insertRange on immutable List.");
77 } 76 }
78 77
79 List<$E> getRange(int start, int rangeLength) => 78 List<$E> getRange(int start, int rangeLength) =>
80 _Lists.getRange(this, start, rangeLength, <$E>[]); 79 _Lists.getRange(this, start, rangeLength, <$E>[]);
81 80
82 // -- end List<$E> mixins. 81 // -- end List<$E> mixins.
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698