Fix DeepSource anti-pattern

This commit is contained in:
Matt Joiner 2021-03-25 09:56:04 +11:00
parent 80cfe96c8b
commit 615ac41ae3
1 changed files with 1 additions and 3 deletions

View File

@ -70,9 +70,7 @@ func (mi *MetaInfo) SetDefaults() {
// Creates a Magnet from a MetaInfo. Optional infohash and parsed info can be provided.
func (mi *MetaInfo) Magnet(infoHash *Hash, info *Info) (m Magnet) {
for _, t := range mi.UpvertedAnnounceList().DistinctValues() {
m.Trackers = append(m.Trackers, t)
}
m.Trackers = append(m.Trackers, mi.UpvertedAnnounceList().DistinctValues()...)
if info != nil {
m.DisplayName = info.Name
}