Lines Matching refs:score

58 zskiplistNode *zslCreateNode(int level, double score, robj *obj) {  in zslCreateNode()  argument
60 zn->score = score; in zslCreateNode()
110 zskiplistNode *zslInsert(zskiplist *zsl, double score, robj *obj) { in zslInsert() argument
115 serverAssert(!isnan(score)); in zslInsert()
121 (x->level[i].forward->score < score || in zslInsert()
122 (x->level[i].forward->score == score && in zslInsert()
142 x = zslCreateNode(level,score,obj); in zslInsert()
188 int zslDelete(zskiplist *zsl, double score, robj *obj) { in zslDelete() argument
195 (x->level[i].forward->score < score || in zslDelete()
196 (x->level[i].forward->score == score && in zslDelete()
204 if (x && score == x->score && equalStringObjects(x->obj,obj)) { in zslDelete()
229 if (x == NULL || !zslValueGteMin(x->score,range)) in zslIsInRange()
232 if (x == NULL || !zslValueLteMax(x->score,range)) in zslIsInRange()
250 !zslValueGteMin(x->level[i].forward->score,range)) in zslFirstInRange()
259 if (!zslValueLteMax(x->score,range)) return NULL; in zslFirstInRange()
276 zslValueLteMax(x->level[i].forward->score,range)) in zslLastInRange()
284 if (!zslValueGteMin(x->score,range)) return NULL; in zslLastInRange()
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()
386 unsigned long zslGetRank(zskiplist *zsl, double score, robj *o) { in zslGetRank() argument
394 (x->level[i].forward->score < score || in zslGetRank()
395 (x->level[i].forward->score == score && in zslGetRank()
640 double score; in zzlGetScore() local
648 score = strtod(buf,NULL); in zzlGetScore()
650 score = vlong; in zzlGetScore()
653 return score; in zzlGetScore()
741 double score; in zzlIsInRange() local
750 score = zzlGetScore(p); in zzlIsInRange()
751 if (!zslValueGteMin(score,range)) in zzlIsInRange()
756 score = zzlGetScore(p); in zzlIsInRange()
757 if (!zslValueLteMax(score,range)) in zzlIsInRange()
767 double score; in zzlFirstInRange() local
776 score = zzlGetScore(sptr); in zzlFirstInRange()
777 if (zslValueGteMin(score,range)) { in zzlFirstInRange()
779 if (zslValueLteMax(score,range)) in zzlFirstInRange()
795 double score; in zzlLastInRange() local
804 score = zzlGetScore(sptr); in zzlLastInRange()
805 if (zslValueLteMax(score,range)) { in zzlLastInRange()
807 if (zslValueGteMin(score,range)) in zzlLastInRange()
915 unsigned char *zzlFind(unsigned char *zl, robj *ele, double *score) { in zzlFind() argument
925 if (score != NULL) *score = zzlGetScore(sptr); in zzlFind()
949 unsigned char *zzlInsertAt(unsigned char *zl, unsigned char *eptr, robj *ele, double score) { in zzlInsertAt() argument
956 scorelen = d2string(scorebuf,sizeof(scorebuf),score); in zzlInsertAt()
976 unsigned char *zzlInsert(unsigned char *zl, robj *ele, double score) { in zzlInsert() argument
986 if (s > score) { in zzlInsert()
990 zl = zzlInsertAt(zl,eptr,ele,score); in zzlInsert()
992 } else if (s == score) { in zzlInsert()
995 zl = zzlInsertAt(zl,eptr,ele,score); in zzlInsert()
1006 zl = zzlInsertAt(zl,NULL,ele,score); in zzlInsert()
1014 double score; in zzlDeleteRangeByScore() local
1025 score = zzlGetScore(sptr); in zzlDeleteRangeByScore()
1026 if (zslValueLteMax(score,range)) { in zzlDeleteRangeByScore()
1097 double score; in zsetConvert() local
1120 score = zzlGetScore(sptr); in zsetConvert()
1128 node = zslInsert(zs->zsl,score,ele); in zsetConvert()
1129 serverAssertWithInfo(NULL,zobj,dictAdd(zs->dict,ele,&node->score) == DICT_OK); in zsetConvert()
1153 zl = zzlInsertAt(zl,NULL,ele,node->score); in zsetConvert()
1185 int zsetScore(robj *zobj, robj *member, double *score) { in zsetScore() argument
1189 if (zzlFind(zobj->ptr, member, score) == NULL) return C_ERR; in zsetScore()
1194 *score = *(double*)dictGetVal(de); in zsetScore()
1217 double score = 0, *scores = NULL, curscore = 0.0; in zaddGenericCommand() local
1298 score = scores[j]; in zaddGenericCommand()
1308 score += curscore; in zaddGenericCommand()
1309 if (isnan(score)) { in zaddGenericCommand()
1316 if (score != curscore) { in zaddGenericCommand()
1318 zobj->ptr = zzlInsert(zobj->ptr,ele,score); in zaddGenericCommand()
1326 zobj->ptr = zzlInsert(zobj->ptr,ele,score); in zaddGenericCommand()
1349 score += curscore; in zaddGenericCommand()
1350 if (isnan(score)) { in zaddGenericCommand()
1361 if (score != curscore) { in zaddGenericCommand()
1363 znode = zslInsert(zs->zsl,score,curobj); in zaddGenericCommand()
1365 dictGetVal(de) = &znode->score; /* Update score ptr. */ in zaddGenericCommand()
1371 znode = zslInsert(zs->zsl,score,ele); in zaddGenericCommand()
1373 serverAssertWithInfo(c,NULL,dictAdd(zs->dict,ele,&znode->score) == DICT_OK); in zaddGenericCommand()
1387 addReplyDouble(c,score); in zaddGenericCommand()
1436 double score; in zremCommand() local
1444 score = *(double*)dictGetVal(de); in zremCommand()
1445 serverAssertWithInfo(c,c->argv[j],zslDelete(zs->zsl,score,c->argv[j])); in zremCommand()
1640 double score; member
1756 val->score = 1.0; in zuiNext()
1764 val->score = 1.0; in zuiNext()
1778 val->score = zzlGetScore(it->zl.sptr); in zuiNext()
1786 val->score = it->sl.node->score; in zuiNext()
1858 int zuiFind(zsetopsrc *op, zsetopval *val, double *score) { in zuiFind() argument
1867 *score = 1.0; in zuiFind()
1876 *score = 1.0; in zuiFind()
1888 if (zzlFind(op->subject->ptr,val->ele,score) != NULL) { in zuiFind()
1898 *score = *(double*)dictGetVal(de); in zuiFind()
2040 double score, value; in zunionInterGenericCommand() local
2042 score = src[0].weight * zval.score; in zunionInterGenericCommand()
2043 if (isnan(score)) score = 0; in zunionInterGenericCommand()
2049 value = zval.score*src[j].weight; in zunionInterGenericCommand()
2050 zunionInterAggregate(&score,value,aggregate); in zunionInterGenericCommand()
2053 zunionInterAggregate(&score,value,aggregate); in zunionInterGenericCommand()
2062 znode = zslInsert(dstzset->zsl,score,tmp); in zunionInterGenericCommand()
2064 dictAdd(dstzset->dict,tmp,&znode->score); in zunionInterGenericCommand()
2079 double score; in zunionInterGenericCommand() local
2095 score = src[i].weight * zval.score; in zunionInterGenericCommand()
2096 if (isnan(score)) score = 0; in zunionInterGenericCommand()
2113 dictSetDoubleVal(de,score); in zunionInterGenericCommand()
2121 zunionInterAggregate(&de->v.d,score,aggregate); in zunionInterGenericCommand()
2137 score = dictGetDoubleVal(de); in zunionInterGenericCommand()
2138 znode = zslInsert(dstzset->zsl,score,ele); in zunionInterGenericCommand()
2140 dictAdd(dstzset->dict,ele,&znode->score); in zunionInterGenericCommand()
2276 addReplyDouble(c,ln->score); in zrangeGenericCommand()
2348 double score; in genericZrangebyscoreCommand() local
2383 score = zzlGetScore(sptr); in genericZrangebyscoreCommand()
2387 if (!zslValueGteMin(score,&range)) break; in genericZrangebyscoreCommand()
2389 if (!zslValueLteMax(score,&range)) break; in genericZrangebyscoreCommand()
2403 addReplyDouble(c,score); in genericZrangebyscoreCommand()
2449 if (!zslValueGteMin(ln->score,&range)) break; in genericZrangebyscoreCommand()
2451 if (!zslValueLteMax(ln->score,&range)) break; in genericZrangebyscoreCommand()
2458 addReplyDouble(c,ln->score); in genericZrangebyscoreCommand()
2506 double score; in zcountCommand() local
2519 score = zzlGetScore(sptr); in zcountCommand()
2520 serverAssertWithInfo(c,zobj,zslValueLteMax(score,&range)); in zcountCommand()
2524 score = zzlGetScore(sptr); in zcountCommand()
2527 if (!zslValueLteMax(score,&range)) { in zcountCommand()
2545 rank = zslGetRank(zsl, zn->score, zn->obj); in zcountCommand()
2553 rank = zslGetRank(zsl, zn->score, zn->obj); in zcountCommand()
2623 rank = zslGetRank(zsl, zn->score, zn->obj); in zlexcountCommand()
2631 rank = zslGetRank(zsl, zn->score, zn->obj); in zlexcountCommand()
2841 double score; in zscoreCommand() local
2846 if (zsetScore(zobj,c->argv[2],&score) == C_ERR) { in zscoreCommand()
2849 addReplyDouble(c,score); in zscoreCommand()
2895 double score; in zrankGenericCommand() local
2900 score = *(double*)dictGetVal(de); in zrankGenericCommand()
2901 rank = zslGetRank(zsl,score,ele); in zrankGenericCommand()