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

Function migrateGetKeys

src/db.cpp:2312–2337  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2310}
2311
2312int migrateGetKeys(struct redisCommand *cmd, robj **argv, int argc, getKeysResult *result) {
2313 int i, num, first, *keys;
2314 UNUSED(cmd);
2315
2316 /* Assume the obvious form. */
2317 first = 3;
2318 num = 1;
2319
2320 /* But check for the extended one with the KEYS option. */
2321 if (argc > 6) {
2322 for (i = 6; i < argc; i++) {
2323 if (!strcasecmp(szFromObj(argv[i]),"keys") &&
2324 sdslen(szFromObj(argv[3])) == 0)
2325 {
2326 first = i+1;
2327 num = argc-first;
2328 break;
2329 }
2330 }
2331 }
2332
2333 keys = getKeysPrepareResult(result, num);
2334 for (i = 0; i < num; i++) keys[i] = first+i;
2335 result->numkeys = num;
2336 return num;
2337}
2338
2339/* Helper function to extract keys from following commands:
2340 * GEORADIUS key x y radius unit [WITHDIST] [WITHHASH] [WITHCOORD] [ASC|DESC]

Callers

nothing calls this directly

Calls 3

szFromObjFunction · 0.85
sdslenFunction · 0.85
getKeysPrepareResultFunction · 0.85

Tested by

no test coverage detected