lualoader: shallowCopyTable => deepCopyTable
I called it a shallow copy, but it wasn't really a shallow copy at all.
This commit is contained in:
parent
b1d757bc1d
commit
ee4e69f1b9
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=329854
@ -286,11 +286,11 @@ function core.isSystem386()
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- This may be a better candidate for a 'utility' module.
|
-- This may be a better candidate for a 'utility' module.
|
||||||
function core.shallowCopyTable(tbl)
|
function core.deepCopyTable(tbl)
|
||||||
local new_tbl = {}
|
local new_tbl = {}
|
||||||
for k, v in pairs(tbl) do
|
for k, v in pairs(tbl) do
|
||||||
if type(v) == "table" then
|
if type(v) == "table" then
|
||||||
new_tbl[k] = core.shallowCopyTable(v)
|
new_tbl[k] = core.deepCopyTable(v)
|
||||||
else
|
else
|
||||||
new_tbl[k] = v
|
new_tbl[k] = v
|
||||||
end
|
end
|
||||||
|
@ -222,7 +222,7 @@ menu.welcome = {
|
|||||||
return menu.welcome.swapped_menu
|
return menu.welcome.swapped_menu
|
||||||
end
|
end
|
||||||
-- Shallow copy the table
|
-- Shallow copy the table
|
||||||
menu_entries = core.shallowCopyTable(menu_entries)
|
menu_entries = core.deepCopyTable(menu_entries)
|
||||||
|
|
||||||
-- Swap the first two menu entries
|
-- Swap the first two menu entries
|
||||||
menu_entries[1], menu_entries[2] =
|
menu_entries[1], menu_entries[2] =
|
||||||
|
Loading…
Reference in New Issue
Block a user