]> Sergey Matveev's repositories - btrtrc.git/commitdiff
clone func used since go 1.21 (#947)
authorucwong <ucwong@126.com>
Thu, 30 May 2024 23:16:37 +0000 (00:16 +0100)
committerGitHub <noreply@github.com>
Thu, 30 May 2024 23:16:37 +0000 (09:16 +1000)
metainfo/announcelist.go

index f19af14ccd04a4442ccd64812d793e0c616f51d1..3bed58d60b182a5486dfbcca4dbbc3570c9df3e1 100644 (file)
@@ -1,12 +1,13 @@
 package metainfo
 
+import (
+       "slices"
+)
+
 type AnnounceList [][]string
 
-func (al AnnounceList) Clone() (ret AnnounceList) {
-       for _, tier := range al {
-               ret = append(ret, append([]string(nil), tier...))
-       }
-       return
+func (al AnnounceList) Clone() AnnounceList {
+       return slices.Clone(al)
 }
 
 // Whether the AnnounceList should be preferred over a single URL announce.