MCPcopy Create free account
hub / github.com/F-Stack/f-stack / equalStringObjects

Function equalStringObjects

app/redis-6.2.6/src/object.c:594–603  ·  view source on GitHub ↗

Equal string objects return 1 if the two objects are the same from the * point of view of a string comparison, otherwise 0 is returned. Note that * this function is faster then checking for (compareStringObject(a,b) == 0) * because it can perform some more optimization. */

Source from the content-addressed store, hash-verified

592 * this function is faster then checking for (compareStringObject(a,b) == 0)
593 * because it can perform some more optimization. */
594int equalStringObjects(robj *a, robj *b) {
595 if (a->encoding == OBJ_ENCODING_INT &&
596 b->encoding == OBJ_ENCODING_INT){
597 /* If both strings are integer encoded just check if the stored
598 * long is the same. */
599 return a->ptr == b->ptr;
600 } else {
601 return compareStringObjects(a,b) == 0;
602 }
603}
604
605size_t stringObjectLen(robj *o) {
606 serverAssertWithInfo(NULL,o,o->type == OBJ_STRING);

Callers 3

watchForKeyFunction · 0.85
listMatchObjectsFunction · 0.85
getNodeByQueryFunction · 0.85

Calls 1

compareStringObjectsFunction · 0.85

Tested by

no test coverage detected