Module:MOS: Difference between revisions

ArrowHead294 (talk | contribs)
m Alphabetise dependencies
Ganaram inukshuk (talk | contribs)
switch helper function (find_item_in_table) for the one provided in utils (table_contains)
Line 6: Line 6:
local rat = require("Module:Rational")
local rat = require("Module:Rational")
local utils = require("Module:Utils")
local utils = require("Module:Utils")
--------------------------------------------------------------------------------
------------------------------- HELPER FUNCTIONS -------------------------------
--------------------------------------------------------------------------------
-- Helper function
function p.find_item_in_table(table, item)
local item_found = false
for i = 1, #table do
if table[i] == item then
item_found = true
break
end
end
return item_found
end


--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Line 308: Line 291:
local current_mode = mode_string
local current_mode = mode_string
for i = 1, #mode_string do
for i = 1, #mode_string do
if not p.find_item_in_table(rotations, current_mode) then
if not utils.table_contains(rotations, current_mode) then
table.insert(rotations, current_mode)
table.insert(rotations, current_mode)
end
end