Skip to content

Commit fb58843

Browse files
scheglovCommit Bot
authored and
Commit Bot
committed
Rename methods of CiderByteStore.
Change-Id: Ief2d3308f1284a2c0529758beeb6776e3ef8bb8f Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247935 Reviewed-by: Brian Wilkerson <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]>
1 parent 1b9554d commit fb58843

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

pkg/analyzer/lib/src/dart/micro/cider_byte_store.dart

+8-8
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,18 @@ abstract class CiderByteStore {
2626
/// count.
2727
///
2828
/// Return `null` if the association does not exist.
29-
Uint8List? get2(String key);
29+
Uint8List? get(String key);
3030

3131
/// Associate [bytes] with [key].
3232
/// Return an internalized version of [bytes], the reference count is `1`.
3333
///
3434
/// This method will throw an exception if there is already an association
35-
/// for the [key]. The client should either use [get2] to access data,
36-
/// or first [release2] it.
37-
Uint8List putGet2(String key, Uint8List bytes);
35+
/// for the [key]. The client should either use [get] to access data,
36+
/// or first [release] it.
37+
Uint8List putGet(String key, Uint8List bytes);
3838

3939
/// Decrement the reference count for every key in [keys].
40-
void release2(Iterable<String> keys);
40+
void release(Iterable<String> keys);
4141
}
4242

4343
class CiderByteStoreTestView {
@@ -53,7 +53,7 @@ class MemoryCiderByteStore implements CiderByteStore {
5353
CiderByteStoreTestView? testView;
5454

5555
@override
56-
Uint8List? get2(String key) {
56+
Uint8List? get(String key) {
5757
final entry = map[key];
5858
if (entry == null) {
5959
return null;
@@ -64,7 +64,7 @@ class MemoryCiderByteStore implements CiderByteStore {
6464
}
6565

6666
@override
67-
Uint8List putGet2(String key, Uint8List bytes) {
67+
Uint8List putGet(String key, Uint8List bytes) {
6868
if (map.containsKey(key)) {
6969
throw StateError('Overwriting is not allowed: $key');
7070
}
@@ -75,7 +75,7 @@ class MemoryCiderByteStore implements CiderByteStore {
7575
}
7676

7777
@override
78-
void release2(Iterable<String> keys) {
78+
void release(Iterable<String> keys) {
7979
for (final key in keys) {
8080
final entry = map[key];
8181
if (entry != null) {

pkg/analyzer/lib/src/dart/micro/library_graph.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,7 @@ class _FileStateUnlinked {
770770
// TODO(migration): should not be nullable
771771
Uint8List? unlinkedBytes;
772772
{
773-
unlinkedBytes = location._fsState._byteStore.get2(unlinkedKey);
773+
unlinkedBytes = location._fsState._byteStore.get(unlinkedKey);
774774

775775
if (unlinkedBytes == null || unlinkedBytes.isEmpty) {
776776
isUnlinkedFromCache = false;
@@ -792,7 +792,7 @@ class _FileStateUnlinked {
792792
unlinkedBytes = unlinkedUnit.toBytes();
793793
performance.getDataInt('length').add(unlinkedBytes!.length);
794794
unlinkedBytes =
795-
location._fsState._byteStore.putGet2(unlinkedKey, unlinkedBytes!);
795+
location._fsState._byteStore.putGet(unlinkedKey, unlinkedBytes!);
796796
testData?.unlinkedKeyPut.add(unlinkedKey);
797797
});
798798

pkg/analyzer/lib/src/dart/micro/resolve_file.dart

+4-4
Original file line numberDiff line numberDiff line change
@@ -447,12 +447,12 @@ class FileResolver {
447447
);
448448

449449
// Release the linked data, the reference count is `>= 1`.
450-
byteStore.release2(linkedKeysToRelease);
450+
byteStore.release(linkedKeysToRelease);
451451
}
452452

453453
/// Releases from the cache and clear [removedCacheKeys].
454454
void releaseAndClearRemovedIds() {
455-
byteStore.release2(removedCacheKeys);
455+
byteStore.release(removedCacheKeys);
456456
removedCacheKeys.clear();
457457
}
458458

@@ -903,7 +903,7 @@ class LibraryContext {
903903
}
904904

905905
var resolutionKey = '${cycle.signatureStr}.resolution';
906-
var resolutionBytes = byteStore.get2(resolutionKey);
906+
var resolutionBytes = byteStore.get(resolutionKey);
907907

908908
var unitsInformativeBytes = <Uri, Uint8List>{};
909909
for (var library in cycle.libraries) {
@@ -976,7 +976,7 @@ class LibraryContext {
976976
librariesLinked += cycle.libraries.length;
977977

978978
resolutionBytes = linkResult.resolutionBytes;
979-
resolutionBytes = byteStore.putGet2(resolutionKey, resolutionBytes);
979+
resolutionBytes = byteStore.putGet(resolutionKey, resolutionBytes);
980980
performance.getDataInt('bytesPut').add(resolutionBytes.length);
981981
testData?.forCycle(cycle).putKeys.add(resolutionKey);
982982

0 commit comments

Comments
 (0)