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

Side by Side Diff: runtime/lib/growable_array.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
« no previous file with comments | « runtime/lib/function_patch.dart ('k') | runtime/lib/typeddata.dart » ('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 class _GrowableObjectArray<T> implements List<T> { 5 class _GrowableObjectArray<T> implements List<T> {
6 factory _GrowableObjectArray._uninstantiable() { 6 factory _GrowableObjectArray._uninstantiable() {
7 throw new UnsupportedError( 7 throw new UnsupportedError(
8 "GrowableObjectArray can only be allocated by the VM"); 8 "GrowableObjectArray can only be allocated by the VM");
9 } 9 }
10 10
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 58
59 void retainWhere(bool test(T element)) { 59 void retainWhere(bool test(T element)) {
60 IterableMixinWorkaround.removeWhereList(this, 60 IterableMixinWorkaround.removeWhereList(this,
61 (T element) => !test(element)); 61 (T element) => !test(element));
62 } 62 }
63 63
64 Iterable<T> getRange(int start, int end) { 64 Iterable<T> getRange(int start, int end) {
65 return IterableMixinWorkaround.getRangeList(this, start, end); 65 return IterableMixinWorkaround.getRangeList(this, start, end);
66 } 66 }
67 67
68 void setRange(int start, int length, List<T> from, [int startFrom = 0]) { 68 void setRange(int start, int end, Iterable<T> iterable, [int skipCount = 0]) {
69 IterableMixinWorkaround.setRangeList(this, start, length, from, startFrom); 69 IterableMixinWorkaround.setRangeList(this, start, end, iterable, skipCount);
70 } 70 }
71 71
72 void removeRange(int start, int length) { 72 void removeRange(int start, int length) {
73 if (length == 0) { 73 if (length == 0) {
74 return; 74 return;
75 } 75 }
76 Arrays.rangeCheck(this, start, length); 76 Arrays.rangeCheck(this, start, length);
77 Arrays.copy(this, 77 Arrays.copy(this,
78 start + length, 78 start + length,
79 this, 79 this,
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 } 337 }
338 338
339 Set<T> toSet() { 339 Set<T> toSet() {
340 return new Set<T>.from(this); 340 return new Set<T>.from(this);
341 } 341 }
342 342
343 Map<int, T> asMap() { 343 Map<int, T> asMap() {
344 return IterableMixinWorkaround.asMapList(this); 344 return IterableMixinWorkaround.asMapList(this);
345 } 345 }
346 } 346 }
OLDNEW
« no previous file with comments | « runtime/lib/function_patch.dart ('k') | runtime/lib/typeddata.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698