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. */
| 634 | * this function is faster then checking for (compareStringObject(a,b) == 0) |
| 635 | * because it can perform some more optimization. */ |
| 636 | int equalStringObjects(robj *a, robj *b) { |
| 637 | if (a->encoding == OBJ_ENCODING_INT && |
| 638 | b->encoding == OBJ_ENCODING_INT){ |
| 639 | /* If both strings are integer encoded just check if the stored |
| 640 | * long is the same. */ |
| 641 | return a->m_ptr == b->m_ptr; |
| 642 | } else { |
| 643 | return compareStringObjects(a,b) == 0; |
| 644 | } |
| 645 | } |
| 646 | |
| 647 | size_t stringObjectLen(robj_roptr o) { |
| 648 | serverAssertWithInfo(NULL,o,o->type == OBJ_STRING); |
no test coverage detected