From 4b6c569de89aa5c9db51328743de3a2e14a97714 Mon Sep 17 00:00:00 2001 From: Alexey Kostin Date: Sat, 30 Dec 2017 18:20:59 +0300 Subject: [PATCH] newpieces capacity optimize --- b2q.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2q.go b/b2q.go index 74476fa..a78f436 100644 --- a/b2q.go +++ b/b2q.go @@ -59,7 +59,7 @@ func gethash(info map[string]interface{}) (hash string) { } func piecesconvert(s string) []byte { - var newpieces = make([]byte, 0 , len(s)) + var newpieces = make([]byte, 0 , len(s) * 8) for _, c := range []byte(s) { var binString string binString = fmt.Sprintf("%s%.8b", binString, c)