Skip to content

Commit

Permalink
refactor: remove useless statements
Browse files Browse the repository at this point in the history
  • Loading branch information
buraksezer committed Jul 10, 2021
1 parent 9c76c67 commit 3538706
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions internal/bufpool/bufpool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,14 @@ import "testing"

func TestBufPool(t *testing.T) {
p := New()

count := 1000
mebibyte := 1 << 20
total := 10 * mebibyte

b := make([]byte, total/count)

for i := 0; i < count; i++ {
b := make([]byte, 100)
for i := 0; i < 1000; i++ {
buf := p.Get()
nr, err := buf.Write(b)
if err != nil {
t.Fatalf("Expected nil. Got: %v", err)
}
if nr != total/count {
if nr != 100 {
t.Fatalf("Expected 10. Got: %d", nr)
}
p.Put(buf)
Expand Down

0 comments on commit 3538706

Please sign in to comment.