Tree: Modify loop conditions to improve performance (#15699)

pull/16185/head
阿尔卑斯 2019-06-04 11:30:09 +08:00 committed by island205
parent d274358dcc
commit 1b8e3d823b
1 changed files with 1 additions and 4 deletions

View File

@ -44,10 +44,7 @@ export default class TreeStore {
if (!node.visible && childNodes.length) {
let allHidden = true;
childNodes.forEach((child) => {
if (child.visible) allHidden = false;
});
allHidden = !childNodes.some(child => child.visible);
if (node.root) {
node.root.visible = allHidden === false;