Modul:TableTools: Unterschied zwischen den Versionen

use select rather than {...}
(p.affixNums: move the pattern-generating code out of the loop)
(use select rather than {...})
Zeile 46: Zeile 46:
--]]
--]]
function p.union(...)
function p.union(...)
local tables = {...}
local vals, ret = {}, {}
local vals, ret = {}, {}
for _, t in ipairs(tables) do
for i = 1, select('#', ...) do
local t = select(i, ...)
for k, v in pairs(t) do
for k, v in pairs(t) do
if type(v) == 'number' and tostring(v) == '-nan' then
if type(v) == 'number' and tostring(v) == '-nan' then
Zeile 77: Zeile 77:
--]]
--]]
function p.intersection(...)
function p.intersection(...)
local tables = {...}
local vals, ret = {}, {}
local vals, ret = {}, {}
local lim = #tables
local lim = #tables
for _, t in ipairs(tables) do
for i = 1, select('#', ...) do
local t = select(i, ...)
for k, v in pairs(t) do
for k, v in pairs(t) do
if type(v) == 'number' and tostring(v) == '-nan' then
if type(v) == 'number' and tostring(v) == '-nan' then
Anonymer Benutzer