mirror of
https://github.com/minetest-mods/moreblocks.git
synced 2025-07-03 16:40:42 +02:00
functional, except saw, legacy, other compatability
This commit is contained in:
@ -4,5 +4,22 @@ stairsplus.util = {
|
||||
t[key] = value
|
||||
end
|
||||
return t
|
||||
end,
|
||||
|
||||
table_is_empty = function(t)
|
||||
return not next(t)
|
||||
end,
|
||||
|
||||
table_sort_keys = function(t, sort_function)
|
||||
local sorted = {}
|
||||
for key in pairs(t) do
|
||||
table.insert(sorted, key)
|
||||
end
|
||||
if sort_function then
|
||||
table.sort(sorted, sort_function)
|
||||
else
|
||||
table.sort(sorted)
|
||||
end
|
||||
return sorted
|
||||
end
|
||||
}
|
||||
|
Reference in New Issue
Block a user