From 8d7d8afa29550c262a8921704d002eb98555503f Mon Sep 17 00:00:00 2001 From: Scorbajio Date: Sun, 24 Sep 2023 14:54:56 -0700 Subject: [PATCH] Simplify code (#3058) --- packages/statemanager/src/cache/storage.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/packages/statemanager/src/cache/storage.ts b/packages/statemanager/src/cache/storage.ts index e7b3acbb73..52ae969bc7 100644 --- a/packages/statemanager/src/cache/storage.ts +++ b/packages/statemanager/src/cache/storage.ts @@ -53,12 +53,7 @@ export class StorageCache extends Cache { _saveCachePreState(addressHex: string, keyHex: string) { const addressStoragePreState = this._diffCache[this._checkpoints].get(addressHex) - let diffStorageMap: DiffStorageCacheMap - if (addressStoragePreState === undefined) { - diffStorageMap = new Map() - } else { - diffStorageMap = addressStoragePreState - } + const diffStorageMap: DiffStorageCacheMap = addressStoragePreState ?? new Map() if (!diffStorageMap.has(keyHex)) { let oldStorageMap: StorageCacheMap | undefined