From owner-svn-src-head@freebsd.org Fri Feb 23 14:49:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20709F27E6F; Fri, 23 Feb 2018 14:49:17 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D02E8397D; Fri, 23 Feb 2018 14:49:16 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w1NEnEc1096158; Fri, 23 Feb 2018 06:49:14 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w1NEnEf0096157; Fri, 23 Feb 2018 06:49:14 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201802231449.w1NEnEf0096157@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r329854 - head/stand/lua In-Reply-To: <201802230318.w1N3IOmX028961@repo.freebsd.org> To: Kyle Evans Date: Fri, 23 Feb 2018 06:49:14 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Feb 2018 14:49:17 -0000 [ Charset UTF-8 unsupported, converting... ] > Author: kevans > Date: Fri Feb 23 03:18:24 2018 > New Revision: 329854 > URL: https://svnweb.freebsd.org/changeset/base/329854 > > Log: > lualoader: shallowCopyTable => deepCopyTable > > I called it a shallow copy, but it wasn't really a shallow copy at all. Isnt it really neither shallow nor deep, but just CopyTable? > Modified: > head/stand/lua/core.lua > head/stand/lua/menu.lua > > Modified: head/stand/lua/core.lua > ============================================================================== > --- head/stand/lua/core.lua Fri Feb 23 03:11:43 2018 (r329853) > +++ head/stand/lua/core.lua Fri Feb 23 03:18:24 2018 (r329854) > @@ -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 > > Modified: head/stand/lua/menu.lua > ============================================================================== > --- head/stand/lua/menu.lua Fri Feb 23 03:11:43 2018 (r329853) > +++ head/stand/lua/menu.lua Fri Feb 23 03:18:24 2018 (r329854) > @@ -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] = > > -- Rod Grimes rgrimes@freebsd.org