slightly optimize TreeWalker and integration process
This commit is contained in:
parent
4b865764b8
commit
cc9a857441
@ -393,8 +393,7 @@ export class Item extends AbstractStruct {
|
|||||||
if (this.left && this.left.constructor === Item) {
|
if (this.left && this.left.constructor === Item) {
|
||||||
this.parent = this.left.parent
|
this.parent = this.left.parent
|
||||||
this.parentSub = this.left.parentSub
|
this.parentSub = this.left.parentSub
|
||||||
}
|
} else if (this.right && this.right.constructor === Item) {
|
||||||
if (this.right && this.right.constructor === Item) {
|
|
||||||
this.parent = this.right.parent
|
this.parent = this.right.parent
|
||||||
this.parentSub = this.right.parentSub
|
this.parentSub = this.right.parentSub
|
||||||
}
|
}
|
||||||
|
@ -96,8 +96,12 @@ export class YXmlTreeWalker {
|
|||||||
} else {
|
} else {
|
||||||
// walk right or up in the tree
|
// walk right or up in the tree
|
||||||
while (n !== null) {
|
while (n !== null) {
|
||||||
if (n.right !== null) {
|
/**
|
||||||
n = n.right
|
* @type {Item | null}
|
||||||
|
*/
|
||||||
|
const nxt = n.next
|
||||||
|
if (nxt !== null) {
|
||||||
|
n = nxt
|
||||||
break
|
break
|
||||||
} else if (n.parent === this._root) {
|
} else if (n.parent === this._root) {
|
||||||
n = null
|
n = null
|
||||||
|
Loading…
x
Reference in New Issue
Block a user