From 95a8014b3d7939e859b570be58e4afcecc2be708 Mon Sep 17 00:00:00 2001 From: maggie44 <64841595+maggie44@users.noreply.github.com> Date: Sat, 16 Nov 2024 12:31:05 +0000 Subject: [PATCH] Use built-in copy function to create certificate copies --- cert/cert_v1.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/cert/cert_v1.go b/cert/cert_v1.go index 165e40951..1c97007e0 100644 --- a/cert/cert_v1.go +++ b/cert/cert_v1.go @@ -334,14 +334,8 @@ func (nc *certificateV1) Copy() Certificate { copy(c.signature, nc.signature) copy(c.details.Groups, nc.details.Groups) copy(c.details.PublicKey, nc.details.PublicKey) - - for i, p := range nc.details.Ips { - c.details.Ips[i] = p - } - - for i, p := range nc.details.Subnets { - c.details.Subnets[i] = p - } + copy(c.details.Ips, nc.details.Ips) + copy(c.details.Subnets, nc.details.Subnets) return c }