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

Function lrangeCommand

src/t_list.cpp:515–526  ·  view source on GitHub ↗

LRANGE */

Source from the content-addressed store, hash-verified

513
514/* LRANGE <key> <start> <stop> */
515void lrangeCommand(client *c) {
516 robj_roptr o;
517 long start, end;
518
519 if ((getLongFromObjectOrReply(c, c->argv[2], &start, NULL) != C_OK) ||
520 (getLongFromObjectOrReply(c, c->argv[3], &end, NULL) != C_OK)) return;
521
522 if ((o = lookupKeyReadOrReply(c,c->argv[1],shared.emptyarray)) == nullptr
523 || checkType(c,o,OBJ_LIST)) return;
524
525 addListRangeReply(c,o,start,end,0);
526}
527
528/* LTRIM <key> <start> <stop> */
529void ltrimCommand(client *c) {

Callers

nothing calls this directly

Calls 4

getLongFromObjectOrReplyFunction · 0.85
lookupKeyReadOrReplyFunction · 0.85
checkTypeFunction · 0.85
addListRangeReplyFunction · 0.85

Tested by

no test coverage detected