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

Unified Diff: sdk/lib/_collection_dev/lists.dart

Issue 133273011: Revert "Rename internal library dart:_collection-dev to dart:_internal." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: reapply after revert. Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/_collection_dev/list.dart ('k') | sdk/lib/_collection_dev/print.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_collection_dev/lists.dart
diff --git a/sdk/lib/_collection_dev/lists.dart b/sdk/lib/_collection_dev/lists.dart
deleted file mode 100644
index eed1df599024bf882ed5c884be7eff9b58f116e2..0000000000000000000000000000000000000000
--- a/sdk/lib/_collection_dev/lists.dart
+++ /dev/null
@@ -1,99 +0,0 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-part of dart._collection.dev;
-
-class Lists {
- static void copy(List src, int srcStart,
- List dst, int dstStart, int count) {
- if (srcStart < dstStart) {
- for (int i = srcStart + count - 1, j = dstStart + count - 1;
- i >= srcStart; i--, j--) {
- dst[j] = src[i];
- }
- } else {
- for (int i = srcStart, j = dstStart; i < srcStart + count; i++, j++) {
- dst[j] = src[i];
- }
- }
- }
-
- static bool areEqual(List a, var b) {
- if (identical(a, b)) return true;
- if (!(b is List)) return false;
- int length = a.length;
- if (length != b.length) return false;
-
- for (int i = 0; i < length; i++) {
- if (!identical(a[i], b[i])) return false;
- }
- return true;
- }
-
- /**
- * Returns the index in the list [a] of the given [element], starting
- * the search at index [startIndex] to [endIndex] (exclusive).
- * Returns -1 if [element] is not found.
- */
- static int indexOf(List a,
- Object element,
- int startIndex,
- int endIndex) {
- if (startIndex >= a.length) {
- return -1;
- }
- if (startIndex < 0) {
- startIndex = 0;
- }
- for (int i = startIndex; i < endIndex; i++) {
- if (a[i] == element) {
- return i;
- }
- }
- return -1;
- }
-
- /**
- * Returns the last index in the list [a] of the given [element], starting
- * the search at index [startIndex] to 0.
- * Returns -1 if [element] is not found.
- */
- static int lastIndexOf(List a, Object element, int startIndex) {
- if (startIndex < 0) {
- return -1;
- }
- if (startIndex >= a.length) {
- startIndex = a.length - 1;
- }
- for (int i = startIndex; i >= 0; i--) {
- if (a[i] == element) {
- return i;
- }
- }
- return -1;
- }
-
- static void indicesCheck(List a, int start, int end) {
- if (start < 0 || start > a.length) {
- throw new RangeError.range(start, 0, a.length);
- }
- if (end != null && (end < start || end > a.length)) {
- throw new RangeError.range(end, start, a.length);
- }
- }
-
- static void rangeCheck(List a, int start, int length) {
- if (length < 0) {
- throw new ArgumentError("negative length $length");
- }
- if (start < 0 ) {
- String message = "$start must be greater than or equal to 0";
- throw new RangeError(message);
- }
- if (start + length > a.length) {
- String message = "$start + $length must be in the range [0..${a.length})";
- throw new RangeError(message);
- }
- }
-}
« no previous file with comments | « sdk/lib/_collection_dev/list.dart ('k') | sdk/lib/_collection_dev/print.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698