Skip to content

Commit

Permalink
Tree: Modify loop conditions to improve performance
Browse files Browse the repository at this point in the history
  • Loading branch information
wusiyuan committed May 23, 2019
1 parent 2f94c02 commit c248580
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions packages/tree/src/model/tree-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c248580

Please sign in to comment.