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

Unified Diff: utils/template/utils.dart

Issue 137013002: Removed obsolete code (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Removed libraries not used 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 | « utils/template/uitest.dart ('k') | utils/template/world.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/template/utils.dart
diff --git a/utils/template/utils.dart b/utils/template/utils.dart
deleted file mode 100644
index ca36fc624910ba19e026fc9f8ea94e519e240962..0000000000000000000000000000000000000000
--- a/utils/template/utils.dart
+++ /dev/null
@@ -1,55 +0,0 @@
-// Copyright (c) 2011, 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.
-
-// Collection<T> supports most of the ES 5 Array methods, but it's missing
-// map and reduce.
-
-// TODO(jmesserly): we might want a version of this that return an iterable,
-// however JS, Python and Ruby versions are all eager.
-List map(Iterable source, mapper(source)) {
- List result = new List();
- if (source is List) {
- List list = source; // TODO: shouldn't need this
- result.length = list.length;
- for (int i = 0; i < list.length; i++) {
- result[i] = mapper(list[i]);
- }
- } else {
- for (final item in source) {
- result.add(mapper(item));
- }
- }
- return result;
-}
-
-reduce(Iterable source, callback, [initialValue]) {
- final i = source.iterator;
-
- var current = initialValue;
- if (current == null && i.moveNext()) {
- current = i.current;
- }
- while (i.moveNext()) {
- current = callback(current, i.current);
- }
- return current;
-}
-
-List zip(Iterable left, Iterable right, mapper(left, right)) {
- List result = new List();
- var x = left.iterator;
- var y = right.iterator;
- while (x.moveNext()) {
- if (!y.moveNext()) {
- throw new ArgumentError();
- }
- result.add(mapper(x.current, y.current));
- }
- if (y.moveNext()) {
- throw new ArgumentError();
- }
- return result;
-}
-
-
« no previous file with comments | « utils/template/uitest.dart ('k') | utils/template/world.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698