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

Function migrateGetKeys

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

Source from the content-addressed store, hash-verified

1761}
1762
1763int migrateGetKeys(struct redisCommand *cmd, robj **argv, int argc, getKeysResult *result) {
1764 int i, num, first, *keys;
1765 UNUSED(cmd);
1766
1767 /* Assume the obvious form. */
1768 first = 3;
1769 num = 1;
1770
1771 /* But check for the extended one with the KEYS option. */
1772 if (argc > 6) {
1773 for (i = 6; i < argc; i++) {
1774 if (!strcasecmp(argv[i]->ptr,"keys") &&
1775 sdslen(argv[3]->ptr) == 0)
1776 {
1777 first = i+1;
1778 num = argc-first;
1779 break;
1780 }
1781 }
1782 }
1783
1784 keys = getKeysPrepareResult(result, num);
1785 for (i = 0; i < num; i++) keys[i] = first+i;
1786 result->numkeys = num;
1787 return num;
1788}
1789
1790/* Helper function to extract keys from following commands:
1791 * GEORADIUS key x y radius unit [WITHDIST] [WITHHASH] [WITHCOORD] [ASC|DESC]

Callers

nothing calls this directly

Calls 3

strcasecmpFunction · 0.85
sdslenFunction · 0.85
getKeysPrepareResultFunction · 0.85

Tested by

no test coverage detected