Browse Source

🦄 refactor: 修改为forEach

research/test
iapyang 2 years ago
parent
commit
72c7d698a4
  1. 6
      src/core/structure/tree.js

6
src/core/structure/tree.js

@ -38,8 +38,8 @@
self.addNode(n);
queue.add(n);
});
while (queue.size > 0) {
var [parent] = queue;
queue.forEach(parent => {
queue.delete(parent);
var node = parent.get("data");
@ -49,7 +49,7 @@
queue.add(n);
self.addNode(parent, n);
});
}
});
},
_toJSON: function (node) {

Loading…
Cancel
Save