Skip to content

Commit

Permalink
be consistent about collectionID being a string
Browse files Browse the repository at this point in the history
  • Loading branch information
warner committed Apr 11, 2023
1 parent ee0128d commit 39eb8d5
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions packages/swingset-liveslots/src/collectionManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,13 @@ export function makeCollectionManager(
const { id, subid } = parseVatSlot(vobjID);
const kindName = storeKindIDToName.get(`${id}`);
kindName || Fail`unknown kind ID ${id}`;
const collection = summonCollectionInternal(false, 'test', subid, kindName);
const collectionID = `${subid}`;
const collection = summonCollectionInternal(
false,
'test',
collectionID,
kindName,
);
return collection.sizeInternal();
}

Expand All @@ -655,7 +661,13 @@ export function makeCollectionManager(
}
const { id, subid } = parseVatSlot(vobjID);
const kindName = storeKindIDToName.get(`${id}`);
const collection = summonCollectionInternal(false, 'GC', subid, kindName);
const collectionID = `${subid}`;
const collection = summonCollectionInternal(
false,
'GC',
collectionID,
kindName,
);
allCollectionObjIDs.delete(vobjID);

const doMoreGC = collection.clearInternal(true);
Expand Down Expand Up @@ -686,7 +698,7 @@ export function makeCollectionManager(
assertPattern(valueShape);
schemata.push(valueShape);
}
const collectionID = allocateCollectionID();
const collectionID = `${allocateCollectionID()}`;
const kindID = obtainStoreKindID(kindName);
const vobjID = makeBaseRef(kindID, collectionID, isDurable);

Expand Down Expand Up @@ -908,6 +920,7 @@ export function makeCollectionManager(

function reanimateCollection(vobjID) {
const { id, subid } = parseVatSlot(vobjID);
const collectionID = `${subid}`;
const kindName = storeKindIDToName.get(`${id}`);
const rawSchemata = JSON.parse(
syscall.vatstoreGet(prefixc(subid, '|schemata')),
Expand All @@ -917,7 +930,7 @@ export function makeCollectionManager(
return summonCollection(
false,
label,
subid,
collectionID,
kindName,
keyShape,
valueShape,
Expand Down

0 comments on commit 39eb8d5

Please sign in to comment.