| 728 | } |
| 729 | |
| 730 | double zzlGetScore(unsigned char *sptr) { |
| 731 | unsigned char *vstr; |
| 732 | unsigned int vlen; |
| 733 | long long vlong; |
| 734 | double score; |
| 735 | |
| 736 | serverAssert(sptr != NULL); |
| 737 | serverAssert(ziplistGet(sptr,&vstr,&vlen,&vlong)); |
| 738 | |
| 739 | if (vstr) { |
| 740 | score = zzlStrtod(vstr,vlen); |
| 741 | } else { |
| 742 | score = vlong; |
| 743 | } |
| 744 | |
| 745 | return score; |
| 746 | } |
| 747 | |
| 748 | /* Return a ziplist element as an SDS string. */ |
| 749 | sds ziplistGetObject(unsigned char *sptr) { |
no test coverage detected