Skip to content

Commit

Permalink
refactoring unused refIdsVisited on applyFilters() #75
Browse files Browse the repository at this point in the history
  • Loading branch information
endel committed Jul 14, 2020
1 parent 0ca448c commit bdaf251
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/Schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ export abstract class Schema {
bytes: number[] = [],
useFilters: boolean = false,
) {
const refIdsVisited = new Set<number>();
const refIdsVisited = new WeakSet<ChangeTree>();

const changeTrees: ChangeTree[] = [this.$changes];
let numChangeTrees = 1;
Expand All @@ -552,7 +552,7 @@ export abstract class Schema {
changeTree.ensureRefId();

// mark this ChangeTree as visited.
refIdsVisited.add(changeTree.refId);
refIdsVisited.add(changeTree);

// console.log("SWITCH_TO_STRUCTURE (ENCODE)", {
// ref: ref.constructor.name,
Expand Down Expand Up @@ -780,9 +780,6 @@ export abstract class Schema {
const refIdsDissallowed = new Set<number>();
const refIdsAllowed = new Set<number>([0]);

// sort by refId, from lower to higher.
const refIdsVisited = new Set<number>();

const changeTrees = [this.$changes];
let numChangeTrees = 1;

Expand Down

0 comments on commit bdaf251

Please sign in to comment.