Browse Source

Remove a redundant lazy object instantiation

master
buttercat1791 11 months ago
parent
commit
0a5ae19905
  1. 5
      src/lib/data_structures/publication_tree.ts

5
src/lib/data_structures/publication_tree.ts

@ -89,8 +89,9 @@ export class PublicationTree implements AsyncIterable<NDKEvent> { @@ -89,8 +89,9 @@ export class PublicationTree implements AsyncIterable<NDKEvent> {
parent: parentNode,
children: [],
};
parentNode.children!.push(new Lazy<PublicationTreeNode>(() => Promise.resolve(node)));
this.#nodes.set(address, new Lazy<PublicationTreeNode>(() => Promise.resolve(node)));
const lazyNode = new Lazy<PublicationTreeNode>(() => Promise.resolve(node));
parentNode.children!.push(lazyNode);
this.#nodes.set(address, lazyNode);
this.#events.set(address, event);
}

Loading…
Cancel
Save