MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / lmoveHandlePush

Function lmoveHandlePush

src/t_list.cpp:741–758  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

739}
740
741void lmoveHandlePush(client *c, robj *dstkey, robj *dstobj, robj *value,
742 int where) {
743 /* Create the list if the key does not exist */
744 if (!dstobj) {
745 dstobj = createQuicklistObject();
746 quicklistSetOptions((quicklist*)ptrFromObj(dstobj), g_pserver->list_max_ziplist_size,
747 g_pserver->list_compress_depth);
748 dbAdd(c->db,dstkey,dstobj);
749 }
750 signalModifiedKey(c,c->db,dstkey);
751 listTypePush(dstobj,value,where);
752 notifyKeyspaceEvent(NOTIFY_LIST,
753 where == LIST_HEAD ? "lpush" : "rpush",
754 dstkey,
755 c->db->id);
756 /* Always send the pushed value to the client. */
757 addReplyBulk(c,value);
758}
759
760int getListPositionFromObjectOrReply(client *c, robj *arg, int *position) {
761 if (strcasecmp(szFromObj(arg),"right") == 0) {

Callers 2

lmoveGenericCommandFunction · 0.85
serveClientBlockedOnListFunction · 0.85

Calls 8

createQuicklistObjectFunction · 0.85
quicklistSetOptionsFunction · 0.85
ptrFromObjFunction · 0.85
dbAddFunction · 0.85
signalModifiedKeyFunction · 0.85
listTypePushFunction · 0.85
notifyKeyspaceEventFunction · 0.85
addReplyBulkFunction · 0.85

Tested by

no test coverage detected