OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 typedef num NumericValueSelector<T>(T value); | 5 typedef num NumericValueSelector<T>(T value); |
6 | 6 |
7 /** | 7 /** |
8 * General purpose collection utilities. | 8 * General purpose collection utilities. |
9 * TODO(jmesserly): make these top level functions? | 9 * TODO(jmesserly): make these top level functions? |
10 */ | 10 */ |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 do { | 125 do { |
126 total += iter.next(); | 126 total += iter.next(); |
127 } while (iter.hasNext); | 127 } while (iter.hasNext); |
128 } | 128 } |
129 return total; | 129 return total; |
130 } | 130 } |
131 | 131 |
132 // TODO(jmesserly): something like should exist on Map, either a method or a | 132 // TODO(jmesserly): something like should exist on Map, either a method or a |
133 // constructor, see bug #5340679 | 133 // constructor, see bug #5340679 |
134 static void copyMap(Map dest, Map source) { | 134 static void copyMap(Map dest, Map source) { |
135 for (final k in source.getKeys()) { | 135 for (final k in source.keys) { |
136 dest[k] = source[k]; | 136 dest[k] = source[k]; |
137 } | 137 } |
138 } | 138 } |
139 } | 139 } |
OLD | NEW |