Set RM_StringCompare input args as const (#11010)
Following #10996, it forgot to modify RM_StringCompare in module.c Modified RM_StringCompare, compareStringObjectsWithFlags, compareStringObjects and collateStringObjects.
This commit is contained in:
parent
5ce64ab010
commit
95b88f672a
@ -2576,7 +2576,7 @@ int RM_StringToStreamID(const RedisModuleString *str, RedisModuleStreamID *id) {
|
||||
/* Compare two string objects, returning -1, 0 or 1 respectively if
|
||||
* a < b, a == b, a > b. Strings are compared byte by byte as two
|
||||
* binary blobs without any encoding care / collation attempt. */
|
||||
int RM_StringCompare(RedisModuleString *a, RedisModuleString *b) {
|
||||
int RM_StringCompare(const RedisModuleString *a, const RedisModuleString *b) {
|
||||
return compareStringObjects(a,b);
|
||||
}
|
||||
|
||||
|
@ -710,7 +710,7 @@ robj *getDecodedObject(robj *o) {
|
||||
#define REDIS_COMPARE_BINARY (1<<0)
|
||||
#define REDIS_COMPARE_COLL (1<<1)
|
||||
|
||||
int compareStringObjectsWithFlags(robj *a, robj *b, int flags) {
|
||||
int compareStringObjectsWithFlags(const robj *a, const robj *b, int flags) {
|
||||
serverAssertWithInfo(NULL,a,a->type == OBJ_STRING && b->type == OBJ_STRING);
|
||||
char bufa[128], bufb[128], *astr, *bstr;
|
||||
size_t alen, blen, minlen;
|
||||
@ -743,12 +743,12 @@ int compareStringObjectsWithFlags(robj *a, robj *b, int flags) {
|
||||
}
|
||||
|
||||
/* Wrapper for compareStringObjectsWithFlags() using binary comparison. */
|
||||
int compareStringObjects(robj *a, robj *b) {
|
||||
int compareStringObjects(const robj *a, const robj *b) {
|
||||
return compareStringObjectsWithFlags(a,b,REDIS_COMPARE_BINARY);
|
||||
}
|
||||
|
||||
/* Wrapper for compareStringObjectsWithFlags() using collation. */
|
||||
int collateStringObjects(robj *a, robj *b) {
|
||||
int collateStringObjects(const robj *a, const robj *b) {
|
||||
return compareStringObjectsWithFlags(a,b,REDIS_COMPARE_COLL);
|
||||
}
|
||||
|
||||
|
@ -2650,8 +2650,8 @@ int getLongDoubleFromObject(robj *o, long double *target);
|
||||
int getLongDoubleFromObjectOrReply(client *c, robj *o, long double *target, const char *msg);
|
||||
int getIntFromObjectOrReply(client *c, robj *o, int *target, const char *msg);
|
||||
char *strEncoding(int encoding);
|
||||
int compareStringObjects(robj *a, robj *b);
|
||||
int collateStringObjects(robj *a, robj *b);
|
||||
int compareStringObjects(const robj *a, const robj *b);
|
||||
int collateStringObjects(const robj *a, const robj *b);
|
||||
int equalStringObjects(robj *a, robj *b);
|
||||
unsigned long long estimateObjectIdleTime(robj *o);
|
||||
void trimStringObjectIfNeeded(robj *o);
|
||||
|
Loading…
x
Reference in New Issue
Block a user