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

Side by Side Diff: samples/third_party/dromaeo/Suites.dart

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 library Suites; 1 library Suites;
2 2
3 class Origin { 3 class Origin {
4 final String author; 4 final String author;
5 final String url; 5 final String url;
6 6
7 const Origin(this.author, this.url); 7 const Origin(this.author, this.url);
8 } 8 }
9 9
10 class SuiteDescription { 10 class SuiteDescription {
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 140
141 bool match(suite) { 141 bool match(suite) {
142 // If any conjunction matches, return true. 142 // If any conjunction matches, return true.
143 for (final tagset in taglist) { 143 for (final tagset in taglist) {
144 if (tagset.every((tag) => suite.tags.indexOf(tag) >= 0)) { 144 if (tagset.every((tag) => suite.tags.indexOf(tag) >= 0)) {
145 return true; 145 return true;
146 } 146 }
147 } 147 }
148 return false; 148 return false;
149 } 149 }
150 final suites = SUITE_DESCRIPTIONS.where(match); 150 final suites = SUITE_DESCRIPTIONS.where(match).toList();
151 151
152 suites.sort((s1, s2) => s1.name.compareTo(s2.name)); 152 suites.sort((s1, s2) => s1.name.compareTo(s2.name));
153 return suites; 153 return suites;
154 } 154 }
155 155
156 static getCategory(String tags) { 156 static getCategory(String tags) {
157 if (CATEGORIES.containsKey(tags)) { 157 if (CATEGORIES.containsKey(tags)) {
158 return CATEGORIES[tags]; 158 return CATEGORIES[tags];
159 } 159 }
160 for (final suite in _CORE_SUITE_DESCRIPTIONS) { 160 for (final suite in _CORE_SUITE_DESCRIPTIONS) {
161 if (suite.tags[0] == tags) { 161 if (suite.tags[0] == tags) {
162 return suite.name; 162 return suite.name;
163 } 163 }
164 } 164 }
165 return null; 165 return null;
166 } 166 }
167 } 167 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698