MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / sdscmplex

Function sdscmplex

src/t_zset.cpp:630–635  ·  view source on GitHub ↗

This is just a wrapper to sdscmp() that is able to * handle shared.minstring and shared.maxstring as the equivalent of * -inf and +inf for strings */

Source from the content-addressed store, hash-verified

628 * handle shared.minstring and shared.maxstring as the equivalent of
629 * -inf and +inf for strings */
630int sdscmplex(sds a, sds b) {
631 if (a == b) return 0;
632 if (a == shared.minstring || b == shared.maxstring) return -1;
633 if (a == shared.maxstring || b == shared.minstring) return 1;
634 return sdscmp(a,b);
635}
636
637int zslLexValueGteMin(sds value, zlexrangespec *spec) {
638 return spec->minex ?

Callers 4

zslLexValueGteMinFunction · 0.85
zslLexValueLteMaxFunction · 0.85
zslIsInLexRangeFunction · 0.85
zzlIsInLexRangeFunction · 0.85

Calls 1

sdscmpFunction · 0.85

Tested by

no test coverage detected