Changes
try tweaking the order
-- Define often-used functions as local variables.
local tconcat = table.concat
local tinsert = table.insert
local tremove = table.remove
local ceil = math.ceil
local function toTableEnd(t, pos)
-- Sends the value at position pos to the end of array t, and shifts the
-- other items down accordingly.
return tinsert(t, tremove(t, pos))
end
local p = {}
{pos = 5, val = expiry},
{pos = 3, val = p.matchNamespace(namespace)},
{pos = 4, val = reason},
{pos = 2, val = protLevel},
{pos = 1, val = protType}, {pos = 4, val = reason}
}
-- vandalism categories if they were available.
--]]
local behavior if not reason then behavior = 'reasonFirst' if reason thenelse
behavior = behaviors[reason]
end