mirror of
https://github.com/rumanzo/bt2qbt.git
synced 2024-11-10 04:42:37 +01:00
newpieces capacity optimize
This commit is contained in:
parent
9abe68d02d
commit
4b6c569de8
2
b2q.go
2
b2q.go
@ -59,7 +59,7 @@ func gethash(info map[string]interface{}) (hash string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func piecesconvert(s string) []byte {
|
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) {
|
for _, c := range []byte(s) {
|
||||||
var binString string
|
var binString string
|
||||||
binString = fmt.Sprintf("%s%.8b", binString, c)
|
binString = fmt.Sprintf("%s%.8b", binString, c)
|
||||||
|
Loading…
Reference in New Issue
Block a user