| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 shelf.shelf_unmodifiable_map; | |
| 6 | |
| 7 import 'dart:collection'; | 5 import 'dart:collection'; |
| 8 | 6 |
| 9 import 'package:http_parser/http_parser.dart'; | 7 import 'package:http_parser/http_parser.dart'; |
| 10 | 8 |
| 11 /// A simple wrapper over [UnmodifiableMapView] which avoids re-wrapping itself. | 9 /// A simple wrapper over [UnmodifiableMapView] which avoids re-wrapping itself. |
| 12 class ShelfUnmodifiableMap<V> extends UnmodifiableMapView<String, V> { | 10 class ShelfUnmodifiableMap<V> extends UnmodifiableMapView<String, V> { |
| 13 /// `true` if the key values are already lowercase. | 11 /// `true` if the key values are already lowercase. |
| 14 final bool _ignoreKeyCase; | 12 final bool _ignoreKeyCase; |
| 15 | 13 |
| 16 /// If [source] is a [ShelfUnmodifiableMap] with matching [ignoreKeyCase], | 14 /// If [source] is a [ShelfUnmodifiableMap] with matching [ignoreKeyCase], |
| (...skipping 30 matching lines...) Expand all Loading... |
| 47 ShelfUnmodifiableMap._(Map<String, V> source, this._ignoreKeyCase) | 45 ShelfUnmodifiableMap._(Map<String, V> source, this._ignoreKeyCase) |
| 48 : super(source); | 46 : super(source); |
| 49 } | 47 } |
| 50 | 48 |
| 51 /// A const implementation of an empty [ShelfUnmodifiableMap]. | 49 /// A const implementation of an empty [ShelfUnmodifiableMap]. |
| 52 class _EmptyShelfUnmodifiableMap<V> extends MapView<String, V> | 50 class _EmptyShelfUnmodifiableMap<V> extends MapView<String, V> |
| 53 implements ShelfUnmodifiableMap<V> { | 51 implements ShelfUnmodifiableMap<V> { |
| 54 bool get _ignoreKeyCase => true; | 52 bool get _ignoreKeyCase => true; |
| 55 const _EmptyShelfUnmodifiableMap() : super(const {}); | 53 const _EmptyShelfUnmodifiableMap() : super(const {}); |
| 56 } | 54 } |
| OLD | NEW |