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`.
This commit is contained in:
parent
3603f19496
commit
c07212372c
@ -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++;
|
||||
|
Loading…
x
Reference in New Issue
Block a user