mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-05-06 00:16:40 +07:00
osrm startup helpers added
This commit is contained in:
parent
d9f83425f6
commit
eb091cc1a4
14 changed files with 1928 additions and 0 deletions
osrm/lib
23
osrm/lib/set.lua
Normal file
23
osrm/lib/set.lua
Normal file
|
@ -0,0 +1,23 @@
|
|||
-- Set of items
|
||||
-- Fast check for inclusion, but unordered.
|
||||
--
|
||||
-- Instead of having to do:
|
||||
-- whitelist = { 'apple'=true, 'cherries'=true, 'melons'=true }
|
||||
--
|
||||
-- you can do:
|
||||
-- whitelist = Set { 'apple', 'cherries', 'melons' }
|
||||
--
|
||||
-- and then use it as:
|
||||
-- print( whitelist['cherries'] ) => true
|
||||
|
||||
function Set(source)
|
||||
set = {}
|
||||
if source then
|
||||
for i,v in ipairs(source) do
|
||||
set[v] = true
|
||||
end
|
||||
end
|
||||
return set
|
||||
end
|
||||
|
||||
return Set
|
Loading…
Add table
Add a link
Reference in a new issue