| OLD | NEW |
| 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 #library("dart:coreimpl"); | 5 #library("dart:coreimpl"); |
| 6 | 6 |
| 7 #source("../../corelib/src/implementation/dual_pivot_quicksort.dart"); | 7 #source("../../corelib/src/implementation/dual_pivot_quicksort.dart"); |
| 8 #source("../../corelib/src/implementation/duration_implementation.dart"); | 8 #source("../../corelib/src/implementation/duration_implementation.dart"); |
| 9 #source("../../corelib/src/implementation/exceptions.dart"); | 9 #source("../../corelib/src/implementation/exceptions.dart"); |
| 10 #source("../../corelib/src/implementation/future_implementation.dart"); | 10 #source("../../corelib/src/implementation/future_implementation.dart"); |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 ret[itemsAndKeys[i++]] = itemsAndKeys[i++]; | 226 ret[itemsAndKeys[i++]] = itemsAndKeys[i++]; |
| 227 } | 227 } |
| 228 return ret; | 228 return ret; |
| 229 } | 229 } |
| 230 | 230 |
| 231 ImmutableMap _constMap(List itemsAndKeys) { | 231 ImmutableMap _constMap(List itemsAndKeys) { |
| 232 return new ImmutableMap(itemsAndKeys); | 232 return new ImmutableMap(itemsAndKeys); |
| 233 } | 233 } |
| 234 | 234 |
| 235 /** An immutable map. */ | 235 /** An immutable map. */ |
| 236 // TODO(jmesserly): extends HashMapImplementation<K, V>? |
| 236 class ImmutableMap<K, V> implements Map<K, V> { | 237 class ImmutableMap<K, V> implements Map<K, V> { |
| 237 final Map<K, V> _internal; | 238 final Map<K, V> _internal; |
| 238 | 239 |
| 239 ImmutableMap(List keyValuePairs) : _internal = _map(keyValuePairs); | 240 ImmutableMap(List keyValuePairs) : _internal = _map(keyValuePairs); |
| 240 | 241 |
| 241 V operator [](K key) => _internal[key]; | 242 V operator [](K key) => _internal[key]; |
| 242 | 243 |
| 243 bool isEmpty() => _internal.isEmpty(); | 244 bool isEmpty() => _internal.isEmpty(); |
| 244 | 245 |
| 245 int get length() => _internal.length; | 246 int get length() => _internal.length; |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 503 } else if (isNaN()) { | 504 } else if (isNaN()) { |
| 504 if (other.isNaN()) { | 505 if (other.isNaN()) { |
| 505 return 0; | 506 return 0; |
| 506 } | 507 } |
| 507 return 1; | 508 return 1; |
| 508 } else { | 509 } else { |
| 509 return -1; | 510 return -1; |
| 510 } | 511 } |
| 511 } | 512 } |
| 512 } | 513 } |
| OLD | NEW |