From 5cd3c9529df93b7e726256e2de17985a57f00e7b Mon Sep 17 00:00:00 2001 From: Oran Agra Date: Tue, 19 Jun 2018 16:43:12 +0300 Subject: [PATCH] 64 bit RDB_OPCODE_RESIZEDB in rdb saving this complication in the code is from times were rdbSaveLen didn't support 64 bits. --- src/rdb.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/rdb.c b/src/rdb.c index e37e2f94..5522cee7 100644 --- a/src/rdb.c +++ b/src/rdb.c @@ -1127,13 +1127,9 @@ int rdbSaveRio(rio *rdb, int *error, int flags, rdbSaveInfo *rsi) { * is currently the largest type we are able to represent in RDB sizes. * However this does not limit the actual size of the DB to load since * these sizes are just hints to resize the hash tables. */ - uint32_t db_size, expires_size; - db_size = (dictSize(db->dict) <= UINT32_MAX) ? - dictSize(db->dict) : - UINT32_MAX; - expires_size = (dictSize(db->expires) <= UINT32_MAX) ? - dictSize(db->expires) : - UINT32_MAX; + uint64_t db_size, expires_size; + db_size = dictSize(db->dict); + expires_size = dictSize(db->expires); if (rdbSaveType(rdb,RDB_OPCODE_RESIZEDB) == -1) goto werr; if (rdbSaveLen(rdb,db_size) == -1) goto werr; if (rdbSaveLen(rdb,expires_size) == -1) goto werr;