[lxc-devel] [lxd/master] lxc/copy.go: Remove unneeded for-loop in c.Run()

TimRots on Github lxc-bot at linuxcontainers.org
Sat Oct 17 22:18:14 UTC 2020


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 395 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20201017/eee72289/attachment.bin>
-------------- next part --------------
From 4d4fb034f61025b41845e191073ada05bf5ac856 Mon Sep 17 00:00:00 2001
From: Tim Rots <tim.rots at protonmail.ch>
Date: Sun, 18 Oct 2020 00:16:43 +0200
Subject: [PATCH] lxc/copy.go: Remove unneeded for-loop in c.Run()

* Removed unneeded forloop in lxc/copy.go

Signed-off-by: Tim Rots <tim.rots at protonmail.ch>
---
 lxc/image.go | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/lxc/image.go b/lxc/image.go
index 424173691d..1d1900174f 100644
--- a/lxc/image.go
+++ b/lxc/image.go
@@ -254,9 +254,7 @@ func (c *cmdImageCopy) Run(cmd *cobra.Command, args []string) error {
 
 	if c.flagCopyAliases {
 		// Also add the original aliases
-		for _, alias := range imgInfo.Aliases {
-			aliases = append(aliases, alias)
-		}
+		aliases = append(aliases, imgInfo.Aliases...)
 	}
 
 	err = ensureImageAliases(destinationServer, aliases, fp)


More information about the lxc-devel mailing list