osrm startup helpers added

This commit is contained in:
muerwre 2018-08-27 15:51:26 +07:00
parent d9f83425f6
commit eb091cc1a4
14 changed files with 1928 additions and 0 deletions
osrm/lib

23
osrm/lib/set.lua Normal file
View 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