Modules: zset lex iterator #1.

This commit is contained in:
antirez
2016-04-21 09:27:13 +02:00
parent 083f5277c5
commit 2b04f86ae5
3 changed files with 77 additions and 4 deletions

View File

@ -549,12 +549,12 @@ void zslFreeLexRange(zlexrangespec *spec) {
spec->max != shared.maxstring) sdsfree(spec->max);
}
/* Populate the rangespec according to the objects min and max.
/* Populate the lex rangespec according to the objects min and max.
*
* Return C_OK on success. On error C_ERR is returned.
* When OK is returned the structure must be freed with zslFreeLexRange(),
* otherwise no release is needed. */
static int zslParseLexRange(robj *min, robj *max, zlexrangespec *spec) {
int zslParseLexRange(robj *min, robj *max, zlexrangespec *spec) {
/* The range can't be valid if objects are integer encoded.
* Every item must start with ( or [. */
if (min->encoding == OBJ_ENCODING_INT ||