Skip to content

Commit 91e41aa

Browse files
committed
fix: remove redundant n.args check
n.args is guaranteed to exist for function/doc.type.function nodes, only n.args[aindex] needs to be checked.
1 parent 8ca1599 commit 91e41aa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

script/vm/compiler.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1354,7 +1354,7 @@ local function compileFunctionParam(func, source)
13541354
local found = false
13551355
for n in funcNode:eachObject() do
13561356
if (n.type == 'doc.type.function' or n.type == 'function')
1357-
and n.args and n.args[aindex] and n.args[aindex] ~= source
1357+
and n.args[aindex] and n.args[aindex] ~= source
13581358
then
13591359
local argNode = vm.compileNode(n.args[aindex])
13601360
for an in argNode:eachObject() do
@@ -1461,7 +1461,7 @@ local function compileFunctionParam(func, source)
14611461
vm.getClassFields(suri, extClass, key, function (field, _isMark)
14621462
for n in vm.compileNode(field):eachObject() do
14631463
if (n.type == 'function' or n.type == 'doc.type.function')
1464-
and n.args and n.args[aindex]
1464+
and n.args[aindex]
14651465
then
14661466
local argNode = vm.compileNode(n.args[aindex])
14671467
for an in argNode:eachObject() do

0 commit comments

Comments
 (0)