OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 import 'dart:collection'; | 5 import 'dart:collection'; |
6 | 6 |
7 /** | 7 /** |
8 * Store of bytes associated with string keys. | 8 * Store of bytes associated with string keys. |
9 * | 9 * |
10 * Each key must be not longer than 100 characters and consist of only `[a-z]`, | 10 * Each key must be not longer than 100 characters and consist of only `[a-z]`, |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 assert(false); | 91 assert(false); |
92 _currentSizeBytes = 0; | 92 _currentSizeBytes = 0; |
93 break; | 93 break; |
94 } | 94 } |
95 String key = _map.keys.first; | 95 String key = _map.keys.first; |
96 List<int> bytes = _map.remove(key); | 96 List<int> bytes = _map.remove(key); |
97 _currentSizeBytes -= bytes.length; | 97 _currentSizeBytes -= bytes.length; |
98 } | 98 } |
99 } | 99 } |
100 } | 100 } |
| 101 |
| 102 /** |
| 103 * [ByteStore] which does not store any data. |
| 104 */ |
| 105 class NullByteStore implements ByteStore { |
| 106 @override |
| 107 List<int> get(String key) => null; |
| 108 |
| 109 @override |
| 110 void put(String key, List<int> bytes) {} |
| 111 } |
OLD | NEW |