Skip to content

Commit

Permalink
fix: snarf deletion records in one go
Browse files Browse the repository at this point in the history
  • Loading branch information
FUDCo committed Mar 13, 2023
1 parent 9c3d219 commit f7f3347
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
5 changes: 1 addition & 4 deletions packages/swing-store/src/snapStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -403,10 +403,7 @@ export function makeSnapStore(
*/
function deleteVatSnapshots(vatID) {
ensureTxn();
const deletions = [];
for (const endPos of sqlGetSnapshotList.iterate(vatID)) {
deletions.push(endPos);
}
const deletions = sqlGetSnapshotList.all(vatID);
for (const endPos of deletions) {
const exportRec = snapshotRec(vatID, endPos, undefined);
noteExport(snapshotMetadataKey(exportRec), undefined);
Expand Down
5 changes: 1 addition & 4 deletions packages/swing-store/src/transcriptStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,7 @@ export function makeTranscriptStore(
*/
function deleteVatTranscripts(vatID) {
ensureTxn();
const deletions = [];
for (const startPos of sqlGetVatSpans.iterate(vatID)) {
deletions.push(startPos);
}
const deletions = sqlGetVatSpans.all(vatID);
for (const startPos of deletions) {
const exportRec = spanRec(vatID, startPos);
noteExport(historicSpanMetadataKey(exportRec), undefined);
Expand Down

0 comments on commit f7f3347

Please sign in to comment.