Skip to content

Commit

Permalink
clone func used since go 1.21 (anacrolix#947)
Browse files Browse the repository at this point in the history
  • Loading branch information
ucwong authored May 30, 2024
1 parent 7958f02 commit d196bf9
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions metainfo/announcelist.go
Original file line number Diff line number Diff line change
@@ -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.
Expand Down

0 comments on commit d196bf9

Please sign in to comment.