Module:TableTools: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
p.affixNums: move the pattern-generating code out of the loop |
use select rather than {...} |
||
Line 46: | Line 46: | ||
--]] |
--]] |
||
function p.union(...) |
function p.union(...) |
||
local tables = {...} |
|||
local vals, ret = {}, {} |
local vals, ret = {}, {} |
||
for |
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 |
||
Line 77: | Line 77: | ||
--]] |
--]] |
||
function p.intersection(...) |
function p.intersection(...) |
||
local tables = {...} |
|||
local vals, ret = {}, {} |
local vals, ret = {}, {} |
||
local lim = #tables |
local lim = #tables |
||
for |
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 |