Skip to content

Commit

Permalink
Avoid creating dependencies during serialization 2 [improve]
Browse files Browse the repository at this point in the history
  • Loading branch information
overlookmotel committed Sep 25, 2023
1 parent 21c54ee commit 0ff8003
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/serialize/serialize.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,7 @@ module.exports = {
// The proxies are the outer boundaries of the graph - their output is definitively known.
// (skip primitives which don't have dependents)
const proxyRecord = createRecord('proxy');
if (record.dependents) {
record.dependents.set(proxyRecord, 1);
} else {
record.dependents = new Map([[proxyRecord, 1]]);
}
record.usageCount++;
proxyRecord.output = output;
output.proxyRecord = proxyRecord;

Expand Down Expand Up @@ -208,7 +204,7 @@ module.exports = {
output.sloppyFnRecords = new Set(this.rootSloppyFnRecords);

// Remove proxy record dependent
record.dependents.delete(output.proxyRecord);
record.usageCount--;

return;
}
Expand Down

0 comments on commit 0ff8003

Please sign in to comment.