diff --git a/rmutil/util.c b/rmutil/util.c index be088eb..ea6fb7b 100644 --- a/rmutil/util.c +++ b/rmutil/util.c @@ -6,7 +6,6 @@ #include #include #include -#include #include #include "util.h" @@ -41,7 +40,7 @@ int RMUtil_ArgIndex(const char *arg, RedisModuleString **argv, int argc) { if (l != larg) continue; if (carg != NULL && strncasecmp(carg, arg, larg) == 0) { return offset; - } \ + } } return -1; } @@ -244,17 +243,4 @@ int RedisModule_TryGetValue(RedisModuleKey *key, const RedisModuleType *type, vo } else { return RMUTIL_VALUE_MISMATCH; } -} - -int RedisModule_Strncasecmp(const RedisModuleString *rs1, const char *s2, size_t n) { - size_t n2; - const char *s1 = RedisModule_StringPtrLen(rs1, &n2); - if (n != n2) { - return -1; - } - return strncasecmp(s1, s2, n); -} - -int RedisModule_Strcasecmp(const RedisModuleString *s1, const char *s2) { - return RedisModule_Strncasecmp(s1, s2, strlen(s2)); } \ No newline at end of file diff --git a/rmutil/util.h b/rmutil/util.h index e6cfcb6..3b3be76 100644 --- a/rmutil/util.h +++ b/rmutil/util.h @@ -130,19 +130,4 @@ typedef enum { */ int RedisModule_TryGetValue(RedisModuleKey *key, const RedisModuleType *type, void **out); -/** - * Compares a RedisModuleString against an actual string buffer, avoiding - * keeping a temporary value for RedisModule_StringPtrLen. - * @param s1 the RedisModuleString - * @param s2 the buffer - * @param n the length of the C string. - * Returns 0 if the strings are equal. - */ -int RedisModule_Strncasecmp(const RedisModuleString *s1, const char *s2, size_t n); - -/** - * Exactly like RedisModule_Strncasecmp, except that `s2` is NUL-terminated - */ -int RedisModule_Strcasecmp(const RedisModuleString *s, const char *s2); - #endif