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

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

Issue 12386072: Move Arrays class to private library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 years, 9 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 part of dart.collection; 5 part of dart._collection.dev;
6 6
7 // TODO(ngeoffray): Rename to Lists. 7 // TODO(ngeoffray): Rename to Lists.
8 class Arrays { 8 class Arrays {
9 static void copy(List src, int srcStart, 9 static void copy(List src, int srcStart,
10 List dst, int dstStart, int count) { 10 List dst, int dstStart, int count) {
11 if (srcStart == null) srcStart = 0;
12 if (dstStart == null) dstStart = 0;
13
14 if (srcStart < dstStart) { 11 if (srcStart < dstStart) {
15 for (int i = srcStart + count - 1, j = dstStart + count - 1; 12 for (int i = srcStart + count - 1, j = dstStart + count - 1;
16 i >= srcStart; i--, j--) { 13 i >= srcStart; i--, j--) {
17 dst[j] = src[i]; 14 dst[j] = src[i];
18 } 15 }
19 } else { 16 } else {
20 for (int i = srcStart, j = dstStart; i < srcStart + count; i++, j++) { 17 for (int i = srcStart, j = dstStart; i < srcStart + count; i++, j++) {
21 dst[j] = src[i]; 18 dst[j] = src[i];
22 } 19 }
23 } 20 }
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 if (start < 0 ) { 82 if (start < 0 ) {
86 String message = "$start must be greater than or equal to 0"; 83 String message = "$start must be greater than or equal to 0";
87 throw new RangeError(message); 84 throw new RangeError(message);
88 } 85 }
89 if (start + length > a.length) { 86 if (start + length > a.length) {
90 String message = "$start + $length must be in the range [0..${a.length})"; 87 String message = "$start + $length must be in the range [0..${a.length})";
91 throw new RangeError(message); 88 throw new RangeError(message);
92 } 89 }
93 } 90 }
94 } 91 }
OLDNEW
« no previous file with comments | « samples/swarm/swarm_ui_lib/observable/observable.dart ('k') | sdk/lib/_collection_dev/collection_dev.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698