diff --git a/src/command.c b/src/command.c index f19bb89c6..5d495384e 100644 --- a/src/command.c +++ b/src/command.c @@ -1168,8 +1168,8 @@ void VS_Print(vsbuf_t *buf, const char *data) #define NAME cvar_map_t #define KEY_TY const char * #define VAL_TY consvar_t * -#define HASH_FN vt_hash_string -#define CMPR_FN vt_cmpr_string +#define HASH_FN FNV1a_HashLowercaseString +#define CMPR_FN vt_cmpr_casestring #include "verstable.h" #define NAME netvar_map_t diff --git a/src/verstable.h b/src/verstable.h index b3fe13f91..d7165e4e9 100644 --- a/src/verstable.h +++ b/src/verstable.h @@ -462,6 +462,8 @@ License (MIT): #include #include +#include "fastcmp.h" + // Two-way concatenation macro. #define VT_CAT_( a, b ) a##b #define VT_CAT( a, b ) VT_CAT_( a, b ) @@ -705,7 +707,12 @@ static inline FORCE_INLINE bool vt_cmpr_integer( uint64_t key_1, uint64_t key_2 static inline FORCE_INLINE bool vt_cmpr_string( const char *key_1, const char *key_2 ) { - return strcmp( key_1, key_2 ) == 0; + return fastcmp( key_1, key_2 ); +} + +static inline FORCE_INLINE bool vt_cmpr_casestring( const char *key_1, const char *key_2 ) +{ + return fasticmp( key_1, key_2 ); } // Default allocation and free functions.