| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 /** Default function for equality comparison in customized HashMaps */ | 7 /** Default function for equality comparison in customized HashMaps */ |
| 8 bool _defaultEquals(a, b) => a == b; | 8 bool _defaultEquals(Object a, Object b) => a == b; |
| 9 /** Default function for hash-code computation in customized HashMaps */ | 9 /** Default function for hash-code computation in customized HashMaps */ |
| 10 int _defaultHashCode(a) => a.hashCode; | 10 int _defaultHashCode(Object a) => a.hashCode; |
| 11 | 11 |
| 12 /** Type of custom equality function */ | 12 /** Type of custom equality function */ |
| 13 typedef bool _Equality<K>(K a, K b); | 13 typedef bool _Equality<K>(K a, K b); |
| 14 /** Type of custom hash code function. */ | 14 /** Type of custom hash code function. */ |
| 15 typedef int _Hasher<K>(K object); | 15 typedef int _Hasher<K>(K object); |
| 16 | 16 |
| 17 /** | 17 /** |
| 18 * A hash-table based implementation of [Map]. | 18 * A hash-table based implementation of [Map]. |
| 19 * | 19 * |
| 20 * The keys of a `HashMap` must have consistent [Object.operator==] | 20 * The keys of a `HashMap` must have consistent [Object.operator==] |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 * overwrites the previous value. | 118 * overwrites the previous value. |
| 119 * | 119 * |
| 120 * It is an error if the two [Iterable]s don't have the same length. | 120 * It is an error if the two [Iterable]s don't have the same length. |
| 121 */ | 121 */ |
| 122 factory HashMap.fromIterables(Iterable<K> keys, Iterable<V> values) { | 122 factory HashMap.fromIterables(Iterable<K> keys, Iterable<V> values) { |
| 123 HashMap<K, V> map = new HashMap<K, V>(); | 123 HashMap<K, V> map = new HashMap<K, V>(); |
| 124 Maps._fillMapWithIterables(map, keys, values); | 124 Maps._fillMapWithIterables(map, keys, values); |
| 125 return map; | 125 return map; |
| 126 } | 126 } |
| 127 } | 127 } |
| OLD | NEW |