Skip to content

Commit

Permalink
refactor: concise default to [] in vatKeeper.addToSnapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
dckc committed Jul 28, 2021
1 parent d074c9e commit e20ad9c
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions packages/SwingSet/src/kernel/state/vatKeeper.js
Original file line number Diff line number Diff line change
Expand Up @@ -471,9 +471,7 @@ export function makeVatKeeper(
*/
function addToSnapshot(snapshotID) {
const key = `snapshot.${snapshotID}`;
const consumersJSON = kvStore.get(key);
const consumers =
consumersJSON !== undefined ? JSON.parse(consumersJSON) : [];
const consumers = JSON.parse(kvStore.get(key) || '[]');
assert(Array.isArray(consumers));

// We can't completely rule out the possibility that
Expand Down

0 comments on commit e20ad9c

Please sign in to comment.