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

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

Issue 13863012: Refactor List.setRange function. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed comments. Created 7 years, 8 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
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.dev; 5 part of dart._collection.dev;
6 6
7 /** 7 /**
8 * Mixin that throws on the length changing operations of [List]. 8 * Mixin that throws on the length changing operations of [List].
9 * 9 *
10 * Intended to mix-in on top of [ListMixin] for fixed-length lists. 10 * Intended to mix-in on top of [ListMixin] for fixed-length lists.
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 E removeAt(int index) { 153 E removeAt(int index) {
154 throw new UnsupportedError( 154 throw new UnsupportedError(
155 "Cannot remove from an unmodifiable list"); 155 "Cannot remove from an unmodifiable list");
156 } 156 }
157 157
158 E removeLast() { 158 E removeLast() {
159 throw new UnsupportedError( 159 throw new UnsupportedError(
160 "Cannot remove from an unmodifiable list"); 160 "Cannot remove from an unmodifiable list");
161 } 161 }
162 162
163 void setRange(int start, int length, List<E> from, [int startFrom]) { 163 void setRange(int start, int end, Iterable<E> iterable, [int skipCount = 0]) {
164 throw new UnsupportedError( 164 throw new UnsupportedError(
165 "Cannot modify an unmodifiable list"); 165 "Cannot modify an unmodifiable list");
166 } 166 }
167 167
168 void removeRange(int start, int length) { 168 void removeRange(int start, int length) {
169 throw new UnsupportedError( 169 throw new UnsupportedError(
170 "Cannot remove from an unmodifiable list"); 170 "Cannot remove from an unmodifiable list");
171 } 171 }
172 172
173 void insertRange(int start, int length, [E initialValue]) { 173 void insertRange(int start, int length, [E initialValue]) {
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 } 249 }
250 250
251 class ReversedListIterable<E> extends ListIterable<E> { 251 class ReversedListIterable<E> extends ListIterable<E> {
252 Iterable<E> _source; 252 Iterable<E> _source;
253 ReversedListIterable(this._source); 253 ReversedListIterable(this._source);
254 254
255 int get length => _source.length; 255 int get length => _source.length;
256 256
257 E elementAt(int index) => _source.elementAt(_source.length - 1 - index); 257 E elementAt(int index) => _source.elementAt(_source.length - 1 - index);
258 } 258 }
OLDNEW
« no previous file with comments | « sdk/lib/_collection_dev/iterable.dart ('k') | sdk/lib/_internal/compiler/implementation/lib/js_array.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698