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

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: Rebuild dom. 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) 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 throw new RangeError.range(end, start, this.length); 73 throw new RangeError.range(end, start, this.length);
74 } 74 }
75 int length = end - start; 75 int length = end - start;
76 if (from is _ObjectArray) { 76 if (from is _ObjectArray) {
77 _copyFromObjectArray(from, startFrom, start, length); 77 _copyFromObjectArray(from, startFrom, start, length);
78 } else { 78 } else {
79 Arrays.copy(from, startFrom, this, start, length); 79 Arrays.copy(from, startFrom, this, start, length);
80 } 80 }
81 } 81 }
82 82
83 void removeRange(int start, int length) { 83 void removeRange(int start, int end) {
84 throw new UnsupportedError( 84 throw new UnsupportedError(
85 "Cannot remove range of a non-extendable array"); 85 "Cannot remove range of a non-extendable array");
86 } 86 }
87 87
88 void insertRange(int start, int length, [E initialValue = null]) { 88 void insertRange(int start, int length, [E initialValue = null]) {
89 throw new UnsupportedError( 89 throw new UnsupportedError(
90 "Cannot insert range in a non-extendable array"); 90 "Cannot insert range in a non-extendable array");
91 } 91 }
92 92
93 93
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 void copyFrom(List src, int srcStart, int dstStart, int count) { 319 void copyFrom(List src, int srcStart, int dstStart, int count) {
320 throw new UnsupportedError( 320 throw new UnsupportedError(
321 "Cannot modify an immutable array"); 321 "Cannot modify an immutable array");
322 } 322 }
323 323
324 void setRange(int start, int end, List<E> from, [int startFrom = 0]) { 324 void setRange(int start, int end, List<E> from, [int startFrom = 0]) {
325 throw new UnsupportedError( 325 throw new UnsupportedError(
326 "Cannot modify an immutable array"); 326 "Cannot modify an immutable array");
327 } 327 }
328 328
329 void removeRange(int start, int length) { 329 void removeRange(int start, int end) {
330 throw new UnsupportedError( 330 throw new UnsupportedError(
331 "Cannot remove range of an immutable array"); 331 "Cannot remove range of an immutable array");
332 } 332 }
333 333
334 void insertRange(int start, int length, [E initialValue = null]) { 334 void insertRange(int start, int length, [E initialValue = null]) {
335 throw new UnsupportedError( 335 throw new UnsupportedError(
336 "Cannot insert range in an immutable array"); 336 "Cannot insert range in an immutable array");
337 } 337 }
338 338
339 List<E> sublist(int start, [int end]) { 339 List<E> sublist(int start, [int end]) {
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 } 533 }
534 _position = _length; 534 _position = _length;
535 _current = null; 535 _current = null;
536 return false; 536 return false;
537 } 537 }
538 538
539 E get current { 539 E get current {
540 return _current; 540 return _current;
541 } 541 }
542 } 542 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698