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

Side by Side Diff: sdk/lib/collection/splay_tree.dart

Issue 716513002: Fix type in generic type of parameters to SplayTreeMap.fromIterable. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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 | « no previous file | tests/corelib/splay_tree_from_iterable_test.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; 5 part of dart.collection;
6 6
7 typedef bool _Predicate<T>(T value); 7 typedef bool _Predicate<T>(T value);
8 8
9 /** 9 /**
10 * A node in a splay tree. It holds the sorting key and the left 10 * A node in a splay tree. It holds the sorting key and the left
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 * 282 *
283 * For each element of the [iterable] this constructor computes a key/value 283 * For each element of the [iterable] this constructor computes a key/value
284 * pair, by applying [key] and [value] respectively. 284 * pair, by applying [key] and [value] respectively.
285 * 285 *
286 * The keys of the key/value pairs do not need to be unique. The last 286 * The keys of the key/value pairs do not need to be unique. The last
287 * occurrence of a key will simply overwrite any previous value. 287 * occurrence of a key will simply overwrite any previous value.
288 * 288 *
289 * If no values are specified for [key] and [value] the default is the 289 * If no values are specified for [key] and [value] the default is the
290 * identity function. 290 * identity function.
291 */ 291 */
292 factory SplayTreeMap.fromIterable(Iterable<K> iterable, 292 factory SplayTreeMap.fromIterable(Iterable iterable,
293 {K key(element), V value(element), int compare(K key1, K key2), 293 {K key(element), V value(element), int compare(K key1, K key2),
294 bool isValidKey(potentialKey) }) { 294 bool isValidKey(potentialKey) }) {
295 SplayTreeMap<K, V> map = new SplayTreeMap<K, V>(compare, isValidKey); 295 SplayTreeMap<K, V> map = new SplayTreeMap<K, V>(compare, isValidKey);
296 Maps._fillMapWithMappedIterable(map, iterable, key, value); 296 Maps._fillMapWithMappedIterable(map, iterable, key, value);
297 return map; 297 return map;
298 } 298 }
299 299
300 /** 300 /**
301 * Creates a [SplayTreeMap] associating the given [keys] to [values]. 301 * Creates a [SplayTreeMap] associating the given [keys] to [values].
302 * 302 *
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after
807 return new _SplayTreeNode<E>(node.key)..left = _copyNode(node.left) 807 return new _SplayTreeNode<E>(node.key)..left = _copyNode(node.left)
808 ..right = _copyNode(node.right); 808 ..right = _copyNode(node.right);
809 } 809 }
810 810
811 void clear() { _clear(); } 811 void clear() { _clear(); }
812 812
813 Set<E> toSet() => _clone(); 813 Set<E> toSet() => _clone();
814 814
815 String toString() => IterableBase.iterableToFullString(this, '{', '}'); 815 String toString() => IterableBase.iterableToFullString(this, '{', '}');
816 } 816 }
OLDNEW
« no previous file with comments | « no previous file | tests/corelib/splay_tree_from_iterable_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698