]> Sergey Matveev's repositories - btrtrc.git/blobdiff - spec.go
Fix allocation of empty DhtNodes in TorrentSpec
[btrtrc.git] / spec.go
diff --git a/spec.go b/spec.go
index e12bb0cb26367626b53fbec35392b0a0e7c4f691..6708db9093ce6420c73bd5312ee067944a3f578f 100644 (file)
--- a/spec.go
+++ b/spec.go
@@ -60,7 +60,7 @@ func TorrentSpecFromMetaInfoErr(mi *metainfo.MetaInfo) (*TorrentSpec, error) {
                DisplayName: info.Name,
                Webseeds:    mi.UrlList,
                DhtNodes: func() (ret []string) {
-                       ret = make([]string, len(mi.Nodes))
+                       ret = make([]string, 0, len(mi.Nodes))
                        for _, node := range mi.Nodes {
                                ret = append(ret, string(node))
                        }