mirror of
https://github.com/appgurueu/modlib.git
synced 2024-08-19 04:44:11 +02:00
Neatify heap
This commit is contained in:
parent
2711e1333a
commit
6691a64484
4
heap.lua
4
heap.lua
@ -1,10 +1,10 @@
|
||||
local metatable = {__index = getfenv(1)}
|
||||
|
||||
function default_less_than(a, b) return a < b end
|
||||
function less_than(a, b) return a < b end
|
||||
|
||||
--> empty min heap
|
||||
function new(less_than)
|
||||
return setmetatable({less_than = less_than or default_less_than}, metatable)
|
||||
return setmetatable({less_than = less_than}, metatable)
|
||||
end
|
||||
|
||||
function push(self, value)
|
||||
|
Loading…
Reference in New Issue
Block a user