mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-11-25 15:47:55 +01:00
Performance optimization removing dump
This commit is contained in:
parent
72018cf6b0
commit
987a271e93
@ -55,10 +55,9 @@ class RootedTreeSet {
|
|||||||
*/
|
*/
|
||||||
add(node: Node) {
|
add(node: Node) {
|
||||||
$assert(node, 'node can not be null');
|
$assert(node, 'node can not be null');
|
||||||
$assert(
|
if (this.find(node.getId(), false)) {
|
||||||
!this.find(node.getId(), false),
|
throw new Error(`node already exits with this id. Id:${node.getId()}: ${this.dump()}`);
|
||||||
`node already exits with this id. Id:${node.getId()}: ${this.dump()}`,
|
}
|
||||||
);
|
|
||||||
$assert(!node._children, 'node already added');
|
$assert(!node._children, 'node already added');
|
||||||
this._rootNodes.push(this._decodate(node));
|
this._rootNodes.push(this._decodate(node));
|
||||||
}
|
}
|
||||||
@ -130,10 +129,11 @@ class RootedTreeSet {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$assert(
|
|
||||||
validate ? result : true,
|
if (validate && !result) {
|
||||||
`node could not be found id:${id}\n,RootedTreeSet${this.dump()}`,
|
throw new Error(`node could not be found id:${id}\n,RootedTreeSet${this.dump()}`);
|
||||||
);
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -258,8 +258,8 @@ class RootedTreeSet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return result
|
* @return result
|
||||||
*/
|
*/
|
||||||
dump() {
|
dump() {
|
||||||
const branches = this._rootNodes;
|
const branches = this._rootNodes;
|
||||||
let result = '';
|
let result = '';
|
||||||
|
Loading…
Reference in New Issue
Block a user