mirror of
https://github.com/calfmoon/node-factor.git
synced 2026-07-22 05:42:24 +00:00
fix(calc): calculation error associated with treeOptimizeMap
This commit is contained in:
parent
7d19749492
commit
b319d722fd
1 changed files with 0 additions and 9 deletions
|
|
@ -54,7 +54,6 @@ export default class NodeFactor extends Plugin {
|
|||
private sizeCache: Map<string, number> = new Map();
|
||||
private updateGraph() {
|
||||
const nodes = this.nodes;
|
||||
this.treeOptimizeMap.clear();
|
||||
setTimeout(() => {
|
||||
nodes.forEach((node, _i) => {
|
||||
let weight = 0;
|
||||
|
|
@ -95,7 +94,6 @@ export default class NodeFactor extends Plugin {
|
|||
return file.stat.size;
|
||||
}
|
||||
|
||||
private treeOptimizeMap: Map<string, number> = new Map();
|
||||
private fwdNodeTreeSize(
|
||||
node: ObsidianNode,
|
||||
antiLoopSet: Set<string>,
|
||||
|
|
@ -103,11 +101,6 @@ export default class NodeFactor extends Plugin {
|
|||
let size = 0;
|
||||
antiLoopSet.add(node.id);
|
||||
|
||||
const sizeMap = this.treeOptimizeMap.get(node.id);
|
||||
if (sizeMap != undefined) {
|
||||
return sizeMap as number;
|
||||
}
|
||||
|
||||
Object.entries(node.forward).forEach(([key, value]) => {
|
||||
// @ts-ignore
|
||||
const childNode: ObsidianNode = value.target;
|
||||
|
|
@ -120,13 +113,11 @@ export default class NodeFactor extends Plugin {
|
|||
size += childSize;
|
||||
});
|
||||
|
||||
this.treeOptimizeMap.set(node.id, size);
|
||||
return size;
|
||||
}
|
||||
|
||||
clearSizeCache() {
|
||||
this.sizeCache.clear();
|
||||
this.treeOptimizeMap.clear();
|
||||
this.updateGraph();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue