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

Side by Side Diff: runtime/lib/array.dart

Issue 11906002: Let list-classes call Collections.joinList (which avoids allocating an iterator). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 | « no previous file | no next file » | 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 5
6 // TODO(srdjan): Use shared array implementation. 6 // TODO(srdjan): Use shared array implementation.
7 class _ObjectArray<E> implements List<E> { 7 class _ObjectArray<E> implements List<E> {
8 8
9 factory _ObjectArray(int length) native "ObjectArray_allocate"; 9 factory _ObjectArray(int length) native "ObjectArray_allocate";
10 10
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 63
64 bool contains(E element) { 64 bool contains(E element) {
65 return Collections.contains(this, element); 65 return Collections.contains(this, element);
66 } 66 }
67 67
68 void forEach(f(E element)) { 68 void forEach(f(E element)) {
69 Collections.forEach(this, f); 69 Collections.forEach(this, f);
70 } 70 }
71 71
72 String join([String separator]) { 72 String join([String separator]) {
73 return Collections.join(this, separator); 73 return Collections.joinList(this, separator);
74 } 74 }
75 75
76 List mappedBy(f(E element)) { 76 List mappedBy(f(E element)) {
77 return new MappedList<E, dynamic>(this, f); 77 return new MappedList<E, dynamic>(this, f);
78 } 78 }
79 79
80 reduce(initialValue, combine(previousValue, E element)) { 80 reduce(initialValue, combine(previousValue, E element)) {
81 return Collections.reduce(this, initialValue, combine); 81 return Collections.reduce(this, initialValue, combine);
82 } 82 }
83 83
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 271
272 void forEach(f(E element)) { 272 void forEach(f(E element)) {
273 Collections.forEach(this, f); 273 Collections.forEach(this, f);
274 } 274 }
275 275
276 List mappedBy(f(E element)) { 276 List mappedBy(f(E element)) {
277 return new MappedList<E, dynamic>(this, f); 277 return new MappedList<E, dynamic>(this, f);
278 } 278 }
279 279
280 String join([String separator]) { 280 String join([String separator]) {
281 return Collections.join(this, separator); 281 return Collections.joinList(this, separator);
282 } 282 }
283 283
284 reduce(initialValue, combine(previousValue, E element)) { 284 reduce(initialValue, combine(previousValue, E element)) {
285 return Collections.reduce(this, initialValue, combine); 285 return Collections.reduce(this, initialValue, combine);
286 } 286 }
287 287
288 Iterable<E> where(bool f(E element)) { 288 Iterable<E> where(bool f(E element)) {
289 return new WhereIterable<E>(this, f); 289 return new WhereIterable<E>(this, f);
290 } 290 }
291 291
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 } 435 }
436 _position = _length; 436 _position = _length;
437 _current = null; 437 _current = null;
438 return false; 438 return false;
439 } 439 }
440 440
441 E get current { 441 E get current {
442 return _current; 442 return _current;
443 } 443 }
444 } 444 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698