Lines Matching refs:range
221 int zslIsInRange(zskiplist *zsl, zrangespec *range) { in zslIsInRange() argument
225 if (range->min > range->max || in zslIsInRange()
226 (range->min == range->max && (range->minex || range->maxex))) in zslIsInRange()
229 if (x == NULL || !zslValueGteMin(x->score,range)) in zslIsInRange()
232 if (x == NULL || !zslValueLteMax(x->score,range)) in zslIsInRange()
239 zskiplistNode *zslFirstInRange(zskiplist *zsl, zrangespec *range) { in zslFirstInRange() argument
244 if (!zslIsInRange(zsl,range)) return NULL; in zslFirstInRange()
250 !zslValueGteMin(x->level[i].forward->score,range)) in zslFirstInRange()
259 if (!zslValueLteMax(x->score,range)) return NULL; in zslFirstInRange()
265 zskiplistNode *zslLastInRange(zskiplist *zsl, zrangespec *range) { in zslLastInRange() argument
270 if (!zslIsInRange(zsl,range)) return NULL; in zslLastInRange()
276 zslValueLteMax(x->level[i].forward->score,range)) in zslLastInRange()
284 if (!zslValueGteMin(x->score,range)) return NULL; in zslLastInRange()
292 unsigned long zslDeleteRangeByScore(zskiplist *zsl, zrangespec *range, dict *dict) { in zslDeleteRangeByScore() argument
299 while (x->level[i].forward && (range->minex ? in zslDeleteRangeByScore()
300 x->level[i].forward->score <= range->min : in zslDeleteRangeByScore()
301 x->level[i].forward->score < range->min)) in zslDeleteRangeByScore()
311 (range->maxex ? x->score < range->max : x->score <= range->max)) in zslDeleteRangeByScore()
323 unsigned long zslDeleteRangeByLex(zskiplist *zsl, zlexrangespec *range, dict *dict) { in zslDeleteRangeByLex() argument
332 !zslLexValueGteMin(x->level[i].forward->obj,range)) in zslDeleteRangeByLex()
341 while (x && zslLexValueLteMax(x->obj,range)) { in zslDeleteRangeByLex()
563 int zslIsInLexRange(zskiplist *zsl, zlexrangespec *range) { in zslIsInLexRange() argument
567 if (compareStringObjectsForLexRange(range->min,range->max) > 1 || in zslIsInLexRange()
568 (compareStringObjects(range->min,range->max) == 0 && in zslIsInLexRange()
569 (range->minex || range->maxex))) in zslIsInLexRange()
572 if (x == NULL || !zslLexValueGteMin(x->obj,range)) in zslIsInLexRange()
575 if (x == NULL || !zslLexValueLteMax(x->obj,range)) in zslIsInLexRange()
582 zskiplistNode *zslFirstInLexRange(zskiplist *zsl, zlexrangespec *range) { in zslFirstInLexRange() argument
587 if (!zslIsInLexRange(zsl,range)) return NULL; in zslFirstInLexRange()
593 !zslLexValueGteMin(x->level[i].forward->obj,range)) in zslFirstInLexRange()
602 if (!zslLexValueLteMax(x->obj,range)) return NULL; in zslFirstInLexRange()
608 zskiplistNode *zslLastInLexRange(zskiplist *zsl, zlexrangespec *range) { in zslLastInLexRange() argument
613 if (!zslIsInLexRange(zsl,range)) return NULL; in zslLastInLexRange()
619 zslLexValueLteMax(x->level[i].forward->obj,range)) in zslLastInLexRange()
627 if (!zslLexValueGteMin(x->obj,range)) return NULL; in zslLastInLexRange()
739 int zzlIsInRange(unsigned char *zl, zrangespec *range) { in zzlIsInRange() argument
744 if (range->min > range->max || in zzlIsInRange()
745 (range->min == range->max && (range->minex || range->maxex))) in zzlIsInRange()
751 if (!zslValueGteMin(score,range)) in zzlIsInRange()
757 if (!zslValueLteMax(score,range)) in zzlIsInRange()
765 unsigned char *zzlFirstInRange(unsigned char *zl, zrangespec *range) { in zzlFirstInRange() argument
770 if (!zzlIsInRange(zl,range)) return NULL; in zzlFirstInRange()
777 if (zslValueGteMin(score,range)) { in zzlFirstInRange()
779 if (zslValueLteMax(score,range)) in zzlFirstInRange()
793 unsigned char *zzlLastInRange(unsigned char *zl, zrangespec *range) { in zzlLastInRange() argument
798 if (!zzlIsInRange(zl,range)) return NULL; in zzlLastInRange()
805 if (zslValueLteMax(score,range)) { in zzlLastInRange()
807 if (zslValueGteMin(score,range)) in zzlLastInRange()
840 int zzlIsInLexRange(unsigned char *zl, zlexrangespec *range) { in zzlIsInLexRange() argument
844 if (compareStringObjectsForLexRange(range->min,range->max) > 1 || in zzlIsInLexRange()
845 (compareStringObjects(range->min,range->max) == 0 && in zzlIsInLexRange()
846 (range->minex || range->maxex))) in zzlIsInLexRange()
851 if (!zzlLexValueGteMin(p,range)) in zzlIsInLexRange()
856 if (!zzlLexValueLteMax(p,range)) in zzlIsInLexRange()
864 unsigned char *zzlFirstInLexRange(unsigned char *zl, zlexrangespec *range) { in zzlFirstInLexRange() argument
868 if (!zzlIsInLexRange(zl,range)) return NULL; in zzlFirstInLexRange()
871 if (zzlLexValueGteMin(eptr,range)) { in zzlFirstInLexRange()
873 if (zzlLexValueLteMax(eptr,range)) in zzlFirstInLexRange()
889 unsigned char *zzlLastInLexRange(unsigned char *zl, zlexrangespec *range) { in zzlLastInLexRange() argument
893 if (!zzlIsInLexRange(zl,range)) return NULL; in zzlLastInLexRange()
896 if (zzlLexValueLteMax(eptr,range)) { in zzlLastInLexRange()
898 if (zzlLexValueGteMin(eptr,range)) in zzlLastInLexRange()
1012 unsigned char *zzlDeleteRangeByScore(unsigned char *zl, zrangespec *range, unsigned long *deleted) { in zzlDeleteRangeByScore() argument
1019 eptr = zzlFirstInRange(zl,range); in zzlDeleteRangeByScore()
1026 if (zslValueLteMax(score,range)) { in zzlDeleteRangeByScore()
1041 unsigned char *zzlDeleteRangeByLex(unsigned char *zl, zlexrangespec *range, unsigned long *deleted)… in zzlDeleteRangeByLex() argument
1047 eptr = zzlFirstInLexRange(zl,range); in zzlDeleteRangeByLex()
1053 if (zzlLexValueLteMax(eptr,range)) { in zzlDeleteRangeByLex()
1480 zrangespec range; in zremrangeGenericCommand() local
1490 if (zslParseRange(c->argv[2],c->argv[3],&range) != C_OK) { in zremrangeGenericCommand()
1528 zobj->ptr = zzlDeleteRangeByScore(zobj->ptr,&range,&deleted); in zremrangeGenericCommand()
1545 deleted = zslDeleteRangeByScore(zs->zsl,&range,zs->dict); in zremrangeGenericCommand()
2294 zrangespec range; in genericZrangebyscoreCommand() local
2312 if (zslParseRange(c->argv[minidx],c->argv[maxidx],&range) != C_OK) { in genericZrangebyscoreCommand()
2352 eptr = zzlLastInRange(zl,&range); in genericZrangebyscoreCommand()
2354 eptr = zzlFirstInRange(zl,&range); in genericZrangebyscoreCommand()
2387 if (!zslValueGteMin(score,&range)) break; in genericZrangebyscoreCommand()
2389 if (!zslValueLteMax(score,&range)) break; in genericZrangebyscoreCommand()
2420 ln = zslLastInRange(zsl,&range); in genericZrangebyscoreCommand()
2422 ln = zslFirstInRange(zsl,&range); in genericZrangebyscoreCommand()
2449 if (!zslValueGteMin(ln->score,&range)) break; in genericZrangebyscoreCommand()
2451 if (!zslValueLteMax(ln->score,&range)) break; in genericZrangebyscoreCommand()
2490 zrangespec range; in zcountCommand() local
2494 if (zslParseRange(c->argv[2],c->argv[3],&range) != C_OK) { in zcountCommand()
2509 eptr = zzlFirstInRange(zl,&range); in zcountCommand()
2520 serverAssertWithInfo(c,zobj,zslValueLteMax(score,&range)); in zcountCommand()
2527 if (!zslValueLteMax(score,&range)) { in zcountCommand()
2541 zn = zslFirstInRange(zsl, &range); in zcountCommand()
2549 zn = zslLastInRange(zsl, &range); in zcountCommand()
2567 zlexrangespec range; in zlexcountCommand() local
2571 if (zslParseLexRange(c->argv[2],c->argv[3],&range) != C_OK) { in zlexcountCommand()
2580 zslFreeLexRange(&range); in zlexcountCommand()
2589 eptr = zzlFirstInLexRange(zl,&range); in zlexcountCommand()
2593 zslFreeLexRange(&range); in zlexcountCommand()
2600 serverAssertWithInfo(c,zobj,zzlLexValueLteMax(eptr,&range)); in zlexcountCommand()
2605 if (!zzlLexValueLteMax(eptr,&range)) { in zlexcountCommand()
2619 zn = zslFirstInLexRange(zsl, &range); in zlexcountCommand()
2627 zn = zslLastInLexRange(zsl, &range); in zlexcountCommand()
2639 zslFreeLexRange(&range); in zlexcountCommand()
2645 zlexrangespec range; in genericZrangebylexCommand() local
2662 if (zslParseLexRange(c->argv[minidx],c->argv[maxidx],&range) != C_OK) { in genericZrangebylexCommand()
2679 zslFreeLexRange(&range); in genericZrangebylexCommand()
2690 zslFreeLexRange(&range); in genericZrangebylexCommand()
2703 eptr = zzlLastInLexRange(zl,&range); in genericZrangebylexCommand()
2705 eptr = zzlFirstInLexRange(zl,&range); in genericZrangebylexCommand()
2711 zslFreeLexRange(&range); in genericZrangebylexCommand()
2737 if (!zzlLexValueGteMin(eptr,&range)) break; in genericZrangebylexCommand()
2739 if (!zzlLexValueLteMax(eptr,&range)) break; in genericZrangebylexCommand()
2767 ln = zslLastInLexRange(zsl,&range); in genericZrangebylexCommand()
2769 ln = zslFirstInLexRange(zsl,&range); in genericZrangebylexCommand()
2775 zslFreeLexRange(&range); in genericZrangebylexCommand()
2797 if (!zslLexValueGteMin(ln->obj,&range)) break; in genericZrangebylexCommand()
2799 if (!zslLexValueLteMax(ln->obj,&range)) break; in genericZrangebylexCommand()
2816 zslFreeLexRange(&range); in genericZrangebylexCommand()