mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-15 04:43:41 +00:00
refactor: piece download logic
This commit is contained in:
1 parent
753830accf
commit
b823dfbb36
5 files changed
+119
-142
No files matched your search
@@ -3,7 +3,6 @@ package metainfo
|
||||
import (
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"github.com/RoaringBitmap/roaring"
|
||||
"testing"
|
||||
)
|
||||
|
||||
@@ -18,12 +17,3 @@ func TestParseFromFile(t *testing.T) {
|
||||
fmt.Printf("%+v\n", metaInfo.Info.PieceLength)
|
||||
fmt.Printf("%+v\n", hex.EncodeToString(metaInfo.infoHash[:]))
|
||||
}
|
||||
|
||||
func TestParseFromFile2(t *testing.T) {
|
||||
bitmap := roaring.NewBitmap()
|
||||
bitmap.AddMany([]uint32{1, 2, 3, 4, 5, 6, 7, 10, 20, 9, 9, 1})
|
||||
fmt.Println(bitmap.Contains(1))
|
||||
fmt.Println(bitmap.Contains(2))
|
||||
fmt.Println(bitmap.Contains(8))
|
||||
fmt.Println(bitmap.GetCardinality())
|
||||
}
|
||||
Reference in new issue
Block a user