From a0c33d065b21c089285cde5e751fed678eaaacc9 Mon Sep 17 00:00:00 2001 From: Matthew Dawson Date: Sat, 17 Oct 2015 14:04:42 -0400 Subject: [PATCH] In TestBucket_Delete_FreelistOverflow, use Cursor.Delete to remove records. When removing all the keys from the bucket, use Cursor.Delete directly, which avoids a seek through the bucket to find the element to delete. This knocks 1/5 of the time off my laptop when running this test while not reducing the amount of overflow pages cleared out of the free list. --- bucket_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bucket_test.go b/bucket_test.go index 62b8c58..57b1d12 100644 --- a/bucket_test.go +++ b/bucket_test.go @@ -253,7 +253,7 @@ func TestBucket_Delete_FreelistOverflow(t *testing.T) { b := tx.Bucket([]byte("0")) c := b.Cursor() for k, _ := c.First(); k != nil; k, _ = c.Next() { - b.Delete(k) + c.Delete() } return nil })