From 95b88f672a54fc66d719c1385008ad8f8cc7d642 Mon Sep 17 00:00:00 2001 From: Binbin Date: Tue, 19 Jul 2022 13:59:39 +0800 Subject: 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. --- src/object.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/object.c') diff --git a/src/object.c b/src/object.c index 84a9e3afc..0f36f8f8c 100644 --- a/src/object.c +++ b/src/object.c @@ -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); } -- cgit v1.2.1