Skip to content

Commit

Permalink
Use built-in copy function to create certificate copies
Browse files Browse the repository at this point in the history
  • Loading branch information
maggie44 committed Nov 16, 2024
1 parent 1004929 commit 95a8014
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions cert/cert_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 95a8014

Please sign in to comment.