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

Side by Side Diff: frog/lib/node/nodeimpl.dart

Issue 9284030: cleanup from r3556 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge again Created 8 years, 11 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 | « frog/lib/node/fs.dart ('k') | frog/minfrog » ('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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 // Utilities used by the node library. 5 // Utilities used by the node library.
6 6
7 #library('nodeimpl'); 7 #library('nodeimpl');
8 #import('dart:coreimpl'); 8 #import('dart:coreimpl');
9 9
10 var require(String module) native; 10 var require(String module) native;
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 List filtered = []; 199 List filtered = [];
200 int len = list.length; 200 int len = list.length;
201 for (int i = 0; i < len; i++) { 201 for (int i = 0; i < len; i++) {
202 var e = list[i]; 202 var e = list[i];
203 if (f(e)) { 203 if (f(e)) {
204 filtered.add(e); 204 filtered.add(e);
205 } 205 }
206 } 206 }
207 int filteredLength = filtered.length; 207 int filteredLength = filtered.length;
208 List result = ctor(filteredLength); 208 List result = ctor(filteredLength);
209 for (int i = 0; i < len; i++) { 209 for (int i = 0; i < filteredLength; i++) {
210 result[i] = filtered[i]; 210 result[i] = filtered[i];
211 } 211 }
212 return result; 212 return result;
213 } 213 }
214 214
215 static bool every(List list, bool f(int element)) { 215 static bool every(List list, bool f(int element)) {
216 int len = list.length; 216 int len = list.length;
217 for (int i = 0; i < len; i++) { 217 for (int i = 0; i < len; i++) {
218 if (! f(list[i])) { 218 if (! f(list[i])) {
219 return false; 219 return false;
(...skipping 16 matching lines...) Expand all
236 for (int i = 0; i < len; i++) { 236 for (int i = 0; i < len; i++) {
237 if (f(list[i])) { 237 if (f(list[i])) {
238 return true; 238 return true;
239 } 239 }
240 } 240 }
241 return false; 241 return false;
242 } 242 }
243 243
244 static bool isEmpty(List list) => list.length == 0; 244 static bool isEmpty(List list) => list.length == 0;
245 } 245 }
OLDNEW
« no previous file with comments | « frog/lib/node/fs.dart ('k') | frog/minfrog » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698