Skip to content

Commit

Permalink
Cluster: make sortGetKeys() able to handle multiple STORE options.
Browse files Browse the repository at this point in the history
It does not make sense to pass multiple store options, so, better to
handle it ;-)
  • Loading branch information
antirez committed Mar 10, 2014
1 parent c4ef1d6 commit 5b86461
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/db.c
Original file line number Diff line number Diff line change
Expand Up @@ -1064,7 +1064,10 @@ int *sortGetKeys(struct redisCommand *cmd, robj **argv, int argc, int *numkeys)
i += skiplist[j].skip;
break;
} else if (!strcasecmp(argv[i]->ptr,"store") && i+1 < argc) {
keys[num++] = i+1; /* <store-key> */
/* Note: we don't increment "num" here and continue the loop
* to be sure to process the *last* "STORE" option if multiple
* ones are provided. This is same behavior as SORT. */
keys[num] = i+1; /* <store-key> */
break;
}
}
Expand Down

0 comments on commit 5b86461

Please sign in to comment.