mirror of
https://github.com/1bardesign/batteries.git
synced 2024-11-25 23:24:35 +00:00
[added] set:to_table which returns the ordered contents unchanged and intentionally disables the set object itself
This commit is contained in:
parent
e957a4502f
commit
028b21ef9a
9
set.lua
9
set.lua
@ -66,6 +66,15 @@ function set:values_readonly()
|
||||
return self._ordered
|
||||
end
|
||||
|
||||
--convert to an ordered table, destroying set-like properties
|
||||
--and deliberately disabling the initial set object
|
||||
function set:to_table()
|
||||
local r = self._ordered
|
||||
self._ordered = nil
|
||||
self._keyed = nil
|
||||
return r
|
||||
end
|
||||
|
||||
--modifying operations
|
||||
|
||||
--add all the elements present in the other set
|
||||
|
Loading…
Reference in New Issue
Block a user