Module:parameters/remove holes: Revision history

Jump to navigation Jump to search

Diff selection: Mark the radio buttons of the revisions to compare and hit enter or the button at the bottom.
Legend: (cur) = difference with latest revision, (prev) = difference with preceding revision, m = minor edit.

6 August 2023

  • curprev 09:0509:05, 6 August 2023Maria talk contribs 541 bytes +541 Created page with "-- A helper function that removes empty numeric indexes in a table, -- so that the values are tightly packed like in a normal Lua table. -- equivalent to require("Module:table").compressSparseArray return function (t) local ret = {} local index = 1 local highest = 0 for num, _ in pairs(t) do if type(num) == "number" and num > 0 and num < math.huge and math.floor(num) == num then highest = math.max(highest, num) end end for i = 1, highest do if t[i] then..."