diff options
| -rw-r--r-- | xmake/core/base/interpreter.lua | 5 | ||||
| -rw-r--r-- | xmake/core/sandbox/modules/irpairs.lua | 2 |
2 files changed, 3 insertions, 4 deletions
diff --git a/xmake/core/base/interpreter.lua b/xmake/core/base/interpreter.lua index 13225ccd5..90e0a57e5 100644 --- a/xmake/core/base/interpreter.lua +++ b/xmake/core/base/interpreter.lua @@ -459,13 +459,12 @@ function interpreter:_filter(values, level) else -- filter value or arrays values = table.wrap(values) - for idx = 1, table.maxn(values) do - + for idx = 1, #values do local value = values[idx] if type(value) == "string" then value = filter:handle(value) elseif table.is_array(value) then - for i = 1, table.maxn(value) do + for i = 1, #value do local v = value[i] if type(v) == "string" then v = filter:handle(v) diff --git a/xmake/core/sandbox/modules/irpairs.lua b/xmake/core/sandbox/modules/irpairs.lua index 7cb175173..d59574481 100644 --- a/xmake/core/sandbox/modules/irpairs.lua +++ b/xmake/core/sandbox/modules/irpairs.lua @@ -60,7 +60,7 @@ function sandbox_irpairs(t, filter, ...) -- return iterator and initialized state t = table.wrap(t) - return iter, t, table.maxn(t) + 1 + return iter, t, table.getn(t) + 1 end -- load module |
