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

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

Issue 107333003: Fix an old TODO. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years 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 | « sdk/lib/_collection_dev/iterable.dart ('k') | sdk/lib/_internal/lib/js_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 part of dart._collection.dev; 5 part of dart._collection.dev;
6 6
7 // TODO(ngeoffray): Rename to Lists. 7 class Lists {
8 class Arrays {
9 static void copy(List src, int srcStart, 8 static void copy(List src, int srcStart,
10 List dst, int dstStart, int count) { 9 List dst, int dstStart, int count) {
11 if (srcStart < dstStart) { 10 if (srcStart < dstStart) {
12 for (int i = srcStart + count - 1, j = dstStart + count - 1; 11 for (int i = srcStart + count - 1, j = dstStart + count - 1;
13 i >= srcStart; i--, j--) { 12 i >= srcStart; i--, j--) {
14 dst[j] = src[i]; 13 dst[j] = src[i];
15 } 14 }
16 } else { 15 } else {
17 for (int i = srcStart, j = dstStart; i < srcStart + count; i++, j++) { 16 for (int i = srcStart, j = dstStart; i < srcStart + count; i++, j++) {
18 dst[j] = src[i]; 17 dst[j] = src[i];
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 if (start < 0 ) { 90 if (start < 0 ) {
92 String message = "$start must be greater than or equal to 0"; 91 String message = "$start must be greater than or equal to 0";
93 throw new RangeError(message); 92 throw new RangeError(message);
94 } 93 }
95 if (start + length > a.length) { 94 if (start + length > a.length) {
96 String message = "$start + $length must be in the range [0..${a.length})"; 95 String message = "$start + $length must be in the range [0..${a.length})";
97 throw new RangeError(message); 96 throw new RangeError(message);
98 } 97 }
99 } 98 }
100 } 99 }
OLDNEW
« no previous file with comments | « sdk/lib/_collection_dev/iterable.dart ('k') | sdk/lib/_internal/lib/js_array.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698