[ccan] [PATCH 04/10] tdb2: remove dead store to "wanted"

Brad Hards bradh at frogmouth.net
Tue Mar 8 20:28:07 EST 2011


This is always overwritten later in this function.
---
 ccan/tdb2/free.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/ccan/tdb2/free.c b/ccan/tdb2/free.c
index d228556..9d3d103 100644
--- a/ccan/tdb2/free.c
+++ b/ccan/tdb2/free.c
@@ -647,9 +647,6 @@ static enum TDB_ERROR tdb_expand(struct tdb_context *tdb, tdb_len_t size)
 	tdb_len_t wanted;
 	enum TDB_ERROR ecode;
 
-	/* We need room for the record header too. */
-	wanted = sizeof(struct tdb_used_record) + size;
-
 	/* Need to hold a hash lock to expand DB: transactions rely on it. */
 	if (!(tdb->flags & TDB_NOLOCK)
 	    && !tdb->allrecord_lock.count && !tdb_has_hash_locks(tdb)) {
-- 
1.7.1



More information about the ccan mailing list