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. */
| 592 | * this function is faster then checking for (compareStringObject(a,b) == 0) |
| 593 | * because it can perform some more optimization. */ |
| 594 | int 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 | |
| 605 | size_t stringObjectLen(robj *o) { |
| 606 | serverAssertWithInfo(NULL,o,o->type == OBJ_STRING); |
no test coverage detected