From 017b9f7eacd1048661b22b7892caf680deb2b548 Mon Sep 17 00:00:00 2001 From: Martin Holst Swende Date: Tue, 30 Jan 2018 18:03:31 +0100 Subject: core, ethdb: reuse database batches (#15989) * leveldb: Update leveldb to 211f780 (poolfix) * core, ethdb: reuse database batches --- ethdb/memory_database.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'ethdb/memory_database.go') diff --git a/ethdb/memory_database.go b/ethdb/memory_database.go index 0dd93a279..8efd7bf84 100644 --- a/ethdb/memory_database.go +++ b/ethdb/memory_database.go @@ -123,3 +123,8 @@ func (b *memBatch) Write() error { func (b *memBatch) ValueSize() int { return b.size } + +func (b *memBatch) Reset() { + b.writes = b.writes[:0] + b.size = 0 +} -- cgit v1.2.3