Module:CommonFunctions: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 92: Line 92:
     end
     end
     return contains
     return contains
end
function table.matches(tbl, val)
    local matches = 0
    for k,v in pairs(tbl) do
      if (v == val) then
          matches = matches + 1
      end
    end
    return matches
end
end