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

Side by Side Diff: sdk/lib/collection/list.dart

Issue 730543002: Remove use of IterableMixinWorkaround from _List, _ImmutableList and _GrowableList. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: addressed comments Created 6 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 // 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 part of dart.collection; 5 part of dart.collection;
6 6
7 /** 7 /**
8 * Abstract implementation of a list. 8 * Abstract implementation of a list.
9 * 9 *
10 * `ListBase` can be used as a base class for implementing the `List` interface. 10 * `ListBase` can be used as a base class for implementing the `List` interface.
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 while (length > 1) { 315 while (length > 1) {
316 int pos = random.nextInt(length); 316 int pos = random.nextInt(length);
317 length -= 1; 317 length -= 1;
318 var tmp = this[length]; 318 var tmp = this[length];
319 this[length] = this[pos]; 319 this[length] = this[pos];
320 this[pos] = tmp; 320 this[pos] = tmp;
321 } 321 }
322 } 322 }
323 323
324 Map<int, E> asMap() { 324 Map<int, E> asMap() {
325 return new ListMapView(this); 325 return new ListMapView<E>(this);
326 } 326 }
327 327
328 void _rangeCheck(int start, int end) { 328 void _rangeCheck(int start, int end) {
329 if (start < 0 || start > this.length) { 329 if (start < 0 || start > this.length) {
330 throw new RangeError.range(start, 0, this.length); 330 throw new RangeError.range(start, 0, this.length);
331 } 331 }
332 if (end < start || end > this.length) { 332 if (end < start || end > this.length) {
333 throw new RangeError.range(end, start, this.length); 333 throw new RangeError.range(end, start, this.length);
334 } 334 }
335 } 335 }
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 for (E element in iterable) { 508 for (E element in iterable) {
509 this[index++] = element; 509 this[index++] = element;
510 } 510 }
511 } 511 }
512 } 512 }
513 513
514 Iterable<E> get reversed => new ReversedListIterable<E>(this); 514 Iterable<E> get reversed => new ReversedListIterable<E>(this);
515 515
516 String toString() => IterableBase.iterableToFullString(this, '[', ']'); 516 String toString() => IterableBase.iterableToFullString(this, '[', ']');
517 } 517 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698