Skip to content
This repository has been archived by the owner on Dec 4, 2020. It is now read-only.

Commit

Permalink
Merge pull request #385 from ibm2431/set
Browse files Browse the repository at this point in the history
Add set constructor
  • Loading branch information
ibm2431 authored Feb 26, 2020
2 parents 63a666c + 0019348 commit d4ba7d1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions scripts/globals/common.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,18 @@ function printf(s,...)
print(s:format(...))
end

-----------------------------------
-- set()
-- Returns a set that can be checked against
-----------------------------------
function set(list)
local set = {}
for _, item in pairs(list) do
set[item] = true
end
return set
end

-----------------------------------
-- getMidnight
-- Returns midnight for the current day in epoch format
Expand Down

0 comments on commit d4ba7d1

Please sign in to comment.