From cee7322fd7d23a1d4eaa801303bb2c838d69a68c Mon Sep 17 00:00:00 2001 From: erhan1209 <82086267+erhan1209@users.noreply.github.com> Date: Wed, 15 Apr 2026 17:37:12 +0300 Subject: [PATCH] Update t_hash.c --- src/t_hash.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/t_hash.c b/src/t_hash.c index c8e6f2d85..7dbe7eab8 100644 --- a/src/t_hash.c +++ b/src/t_hash.c @@ -2914,16 +2914,14 @@ void hgetexCommand(client *c) { } /* Key may become empty due to lazy expiry in addHashFieldToReply() - * or the new expiration time is in the past. Keep the KEYSIZES - * histogram aligned with the fact that an empty hash key is removed. */ + * or the new expiration time is in the past. */ newlen = hashTypeLength(o, 0); - int64_t hist_newlen = (newlen == 0) ? -1 : newlen; - - updateKeysizesHist(c->db, OBJ_HASH, oldlen, hist_newlen); if (newlen == 0) { dbDeleteSkipKeysizesUpdate(c->db, c->argv[1]); notifyKeyspaceEvent(NOTIFY_GENERIC, "del", c->argv[1], c->db->id); + newlen = -1; } + updateKeysizesHist(c->db, OBJ_HASH, oldlen, newlen); } void hdelCommand(client *c) {