diff options
| author | ruki <[email protected]> | 2021-10-10 10:21:59 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-10-10 10:21:59 +0800 |
| commit | eb8ceef85ae8181d86e4e977ab060a477510a079 (patch) | |
| tree | bf6ac9c493414df1e7ddde626ebe6a1d135199a9 | |
| parent | 2e17942f7e29307c64a6404e1b1e9cf753b973b9 (diff) | |
remove some table.maxn
| -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 |
