MCPcopy Create free account
hub / github.com/F-Stack/f-stack / lcsGetKeys

Function lcsGetKeys

app/redis-6.2.6/src/db.c:1829–1851  ·  view source on GitHub ↗

LCS ... [KEYS ] ... */

Source from the content-addressed store, hash-verified

1827
1828/* LCS ... [KEYS <key1> <key2>] ... */
1829int lcsGetKeys(struct redisCommand *cmd, robj **argv, int argc, getKeysResult *result) {
1830 int i;
1831 int *keys = getKeysPrepareResult(result, 2);
1832 UNUSED(cmd);
1833
1834 /* We need to parse the options of the command in order to check for the
1835 * "KEYS" argument before the "STRINGS" argument. */
1836 for (i = 1; i < argc; i++) {
1837 char *arg = argv[i]->ptr;
1838 int moreargs = (argc-1) - i;
1839
1840 if (!strcasecmp(arg, "strings")) {
1841 break;
1842 } else if (!strcasecmp(arg, "keys") && moreargs >= 2) {
1843 keys[0] = i+1;
1844 keys[1] = i+2;
1845 result->numkeys = 2;
1846 return result->numkeys;
1847 }
1848 }
1849 result->numkeys = 0;
1850 return result->numkeys;
1851}
1852
1853/* Helper function to extract keys from memory command.
1854 * MEMORY USAGE <key> */

Callers

nothing calls this directly

Calls 2

getKeysPrepareResultFunction · 0.85
strcasecmpFunction · 0.85

Tested by

no test coverage detected