From ee4e69f1b9b3fd5774d00c87e1a0bbf11859e24d Mon Sep 17 00:00:00 2001 From: Kyle Evans Date: Fri, 23 Feb 2018 03:18:24 +0000 Subject: [PATCH] lualoader: shallowCopyTable => deepCopyTable I called it a shallow copy, but it wasn't really a shallow copy at all. --- stand/lua/core.lua | 4 ++-- stand/lua/menu.lua | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/stand/lua/core.lua b/stand/lua/core.lua index 0dbdfb0d76d8..188612e953ef 100644 --- a/stand/lua/core.lua +++ b/stand/lua/core.lua @@ -286,11 +286,11 @@ function core.isSystem386() end -- This may be a better candidate for a 'utility' module. -function core.shallowCopyTable(tbl) +function core.deepCopyTable(tbl) local new_tbl = {} for k, v in pairs(tbl) do if type(v) == "table" then - new_tbl[k] = core.shallowCopyTable(v) + new_tbl[k] = core.deepCopyTable(v) else new_tbl[k] = v end diff --git a/stand/lua/menu.lua b/stand/lua/menu.lua index acd2dbaa7621..433b05640962 100644 --- a/stand/lua/menu.lua +++ b/stand/lua/menu.lua @@ -222,7 +222,7 @@ menu.welcome = { return menu.welcome.swapped_menu end -- Shallow copy the table - menu_entries = core.shallowCopyTable(menu_entries) + menu_entries = core.deepCopyTable(menu_entries) -- Swap the first two menu entries menu_entries[1], menu_entries[2] =