From owner-svn-src-head@freebsd.org Fri Feb 23 15:49:38 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 40E71F0150F; Fri, 23 Feb 2018 15:49:38 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: from mail-lf0-f54.google.com (mail-lf0-f54.google.com [209.85.215.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A1F4D871B7; Fri, 23 Feb 2018 15:49:37 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: by mail-lf0-f54.google.com with SMTP id y19so12996710lfd.4; Fri, 23 Feb 2018 07:49:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=KOI4SIKrj3TszGurybjK79UuaBF+RhlYLdc5GkA9dKs=; b=D6TTiomBguziG/CXUmm3oYCH5eXg1TEKN+5bpED4CpRqvR/kfxBm+Be3Fq4aQEwepi Ff/xroM19wfrInVpv+ZEhy7zbGsgvSeg11Iq1uX9530SV50cduheMmvO5jHiGhu79sFW aTq05MoKNc4YT6im1we6myuLPG6cyq5m70zvIs2eHeh/6niJcDSNACyguewqPAZm6Fmj 5QLrtO/HVLK2K5Lml1pQtWu/8DhRuUqzb2arRUMq8cHI1GocGR5P8fU3tvppuZ/KWhCq 5meHuIN7e56wfg+3oUS3Y916ILSSSEqOPhXG6T2tKLzG1QxywNG8dPzE/MPqtRZYonsJ wDsA== X-Gm-Message-State: APf1xPA+Dj+ezjFrFpqUCk5pXLp1xJ06FaCgYmpaKHCKkCt+OFK0MpV0 CVHfhIsU1k5JhfUJgM+7DXPiMGFE X-Google-Smtp-Source: AG47ELvgYHv6YOzX10K4y8Kpp+IIknyifu2qsE7VuOvIi0dFvWJ6WcR9STvFVgYGn6QaLaoBpcd8+w== X-Received: by 10.25.35.132 with SMTP id j126mr1644000lfj.130.1519400970093; Fri, 23 Feb 2018 07:49:30 -0800 (PST) Received: from mail-lf0-f54.google.com (mail-lf0-f54.google.com. [209.85.215.54]) by smtp.gmail.com with ESMTPSA id p190sm531276lfp.3.2018.02.23.07.49.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Feb 2018 07:49:30 -0800 (PST) Received: by mail-lf0-f54.google.com with SMTP id 37so12973731lfs.7; Fri, 23 Feb 2018 07:49:29 -0800 (PST) X-Received: by 10.25.201.76 with SMTP id z73mr1693002lff.74.1519400969792; Fri, 23 Feb 2018 07:49:29 -0800 (PST) MIME-Version: 1.0 Received: by 10.46.54.1 with HTTP; Fri, 23 Feb 2018 07:49:09 -0800 (PST) In-Reply-To: <201802231449.w1NEnEf0096157@pdx.rh.CN85.dnsmgr.net> References: <201802230318.w1N3IOmX028961@repo.freebsd.org> <201802231449.w1NEnEf0096157@pdx.rh.CN85.dnsmgr.net> From: Kyle Evans Date: Fri, 23 Feb 2018 09:49:09 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r329854 - head/stand/lua To: "Rodney W. Grimes" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" 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 15:49:38 -0000 On Fri, Feb 23, 2018 at 8:49 AM, Rodney W. Grimes wrote: > [ 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? > I would think (and expect) that CopyTable wouldn't recursively copy any table values in the table as this version does, opting to eliminate that entirely and just copying all values as-is. >> 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