diff options
author | Matthew Dawson <matthew@mjdsystems.ca> | 2015-10-17 14:04:42 -0400 |
---|---|---|
committer | Matthew Dawson <matthew@mjdsystems.ca> | 2015-10-17 14:04:42 -0400 |
commit | a0c33d065b21c089285cde5e751fed678eaaacc9 (patch) | |
tree | 81b048428565a1d9740d975d19121f6da086ac1d | |
parent | Merge pull request #437 from shaggytwodope/master (diff) | |
download | dedo-a0c33d065b21c089285cde5e751fed678eaaacc9.tar.gz dedo-a0c33d065b21c089285cde5e751fed678eaaacc9.tar.xz |
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.
-rw-r--r-- | bucket_test.go | 2 |
1 files changed, 1 insertions, 1 deletions
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 }) |