From de5b6ebf7ac7678b175f59b86491900564eb99da Mon Sep 17 00:00:00 2001 From: Yusuke Higuchi Date: Sat, 2 Dec 2023 02:08:21 +0900 Subject: [PATCH] Remove ipairs from for loop --- src/Components/ComponentTree/Component/init.lua | 2 +- src/Modules/getTreeDescendants.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Components/ComponentTree/Component/init.lua b/src/Components/ComponentTree/Component/init.lua index 8a8704df..81c69960 100644 --- a/src/Components/ComponentTree/Component/init.lua +++ b/src/Components/ComponentTree/Component/init.lua @@ -64,7 +64,7 @@ local function Component(props: Props) end local isEmpty = true - for _, descendant in ipairs(getTreeDescendants(props.node)) do + for _, descendant in getTreeDescendants(props.node) do if descendant.name:lower():match(props.filter:lower()) then isEmpty = false break diff --git a/src/Modules/getTreeDescendants.lua b/src/Modules/getTreeDescendants.lua index 857b2219..d2f829b6 100644 --- a/src/Modules/getTreeDescendants.lua +++ b/src/Modules/getTreeDescendants.lua @@ -10,7 +10,7 @@ local function getTreeDescendants(root: types.ComponentTreeNode): { types.Compon table.insert(descendants, node) end - for _, child in ipairs(node.children) do + for _, child in node.children do traverse(child, false) end end