Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(498)

Side by Side Diff: pkg/analyzer/lib/src/dart/analysis/byte_store.dart

Issue 2653203005: Add NullByteStore, that does not store any data. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698