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

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

Issue 13872007: Refactor removeRange. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status files and rebuild dom (unrelated CL). 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 | « pkg/unittest/lib/mock.dart ('k') | runtime/lib/growable_array.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 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(length) native "ObjectArray_allocate"; 9 factory _ObjectArray(length) native "ObjectArray_allocate";
10 10
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 otherStart = skipCount; 74 otherStart = skipCount;
75 } else { 75 } else {
76 otherList = 76 otherList =
77 iterable.skip(skipCount).take(length).toList(growable: false); 77 iterable.skip(skipCount).take(length).toList(growable: false);
78 otherStart = 0; 78 otherStart = 0;
79 } 79 }
80 Arrays.copy(otherList, otherStart, this, start, length); 80 Arrays.copy(otherList, otherStart, this, start, length);
81 } 81 }
82 } 82 }
83 83
84 void removeRange(int start, int length) { 84 void removeRange(int start, int end) {
85 throw new UnsupportedError( 85 throw new UnsupportedError(
86 "Cannot remove range of a non-extendable array"); 86 "Cannot remove range of a non-extendable array");
87 } 87 }
88 88
89 void insertRange(int start, int length, [E initialValue = null]) { 89 void insertRange(int start, int length, [E initialValue = null]) {
90 throw new UnsupportedError( 90 throw new UnsupportedError(
91 "Cannot insert range in a non-extendable array"); 91 "Cannot insert range in a non-extendable array");
92 } 92 }
93 93
94 94
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 void copyFrom(List src, int srcStart, int dstStart, int count) { 306 void copyFrom(List src, int srcStart, int dstStart, int count) {
307 throw new UnsupportedError( 307 throw new UnsupportedError(
308 "Cannot modify an immutable array"); 308 "Cannot modify an immutable array");
309 } 309 }
310 310
311 void setRange(int start, int end, Iterable<E> iterable, [int skipCount = 0]) { 311 void setRange(int start, int end, Iterable<E> iterable, [int skipCount = 0]) {
312 throw new UnsupportedError( 312 throw new UnsupportedError(
313 "Cannot modify an immutable array"); 313 "Cannot modify an immutable array");
314 } 314 }
315 315
316 void removeRange(int start, int length) { 316 void removeRange(int start, int end) {
317 throw new UnsupportedError( 317 throw new UnsupportedError(
318 "Cannot remove range of an immutable array"); 318 "Cannot remove range of an immutable array");
319 } 319 }
320 320
321 void insertRange(int start, int length, [E initialValue = null]) { 321 void insertRange(int start, int length, [E initialValue = null]) {
322 throw new UnsupportedError( 322 throw new UnsupportedError(
323 "Cannot insert range in an immutable array"); 323 "Cannot insert range in an immutable array");
324 } 324 }
325 325
326 List<E> sublist(int start, [int end]) { 326 List<E> sublist(int start, [int end]) {
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
516 } 516 }
517 _position = _length; 517 _position = _length;
518 _current = null; 518 _current = null;
519 return false; 519 return false;
520 } 520 }
521 521
522 E get current { 522 E get current {
523 return _current; 523 return _current;
524 } 524 }
525 } 525 }
OLDNEW
« no previous file with comments | « pkg/unittest/lib/mock.dart ('k') | runtime/lib/growable_array.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698