summaryrefslogtreecommitdiff
path: root/src/t_string.c
diff options
context:
space:
mode:
authorBrad Dunbar <dunbarb2@gmail.com>2022-08-24 07:11:04 -0400
committerGitHub <noreply@github.com>2022-08-24 14:11:04 +0300
commitc07212372c3e03e9b4f459142d01a5f1895a0f9c (patch)
tree8a83cc8f03e188bfa2f59604198998ecfe44add1 /src/t_string.c
parent3603f19496bdbae084ea2ae15b4b53de41e2b728 (diff)
downloadredis-c07212372c3e03e9b4f459142d01a5f1895a0f9c.tar.gz
Cleanup in GETDEL: Strings are never freed lazily (#11175)
The GETDEL command only operates on strings, and strings are never freed lazily, so there's no need to use `dbAsyncDelete` or `shared.unlink`.
Diffstat (limited to 'src/t_string.c')
-rw-r--r--src/t_string.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/t_string.c b/src/t_string.c
index 7b67b78ce..9d7bc44fc 100644
--- a/src/t_string.c
+++ b/src/t_string.c
@@ -411,12 +411,9 @@ void getexCommand(client *c) {
void getdelCommand(client *c) {
if (getGenericCommand(c) == C_ERR) return;
- int deleted = server.lazyfree_lazy_user_del ? dbAsyncDelete(c->db, c->argv[1]) :
- dbSyncDelete(c->db, c->argv[1]);
- if (deleted) {
- /* Propagate as DEL/UNLINK command */
- robj *aux = server.lazyfree_lazy_user_del ? shared.unlink : shared.del;
- rewriteClientCommandVector(c,2,aux,c->argv[1]);
+ if (dbSyncDelete(c->db, c->argv[1])) {
+ /* Propagate as DEL command */
+ rewriteClientCommandVector(c,2,shared.del,c->argv[1]);
signalModifiedKey(c, c->db, c->argv[1]);
notifyKeyspaceEvent(NOTIFY_GENERIC, "del", c->argv[1], c->db->id);
server.dirty++;