Bladeren bron

pipelimit: use core str comparison functions

Victor Seva 11 maanden geleden
bovenliggende
commit
9ee1898835
1 gewijzigde bestanden met toevoegingen van 1 en 11 verwijderingen
  1. 1 11
      src/modules/pipelimit/pl_ht.h

+ 1 - 11
src/modules/pipelimit/pl_ht.h

@@ -98,16 +98,6 @@ typedef struct str_map
 
 extern str_map_t algo_names[];
 
-static inline int str_cmp(const str *a, const str *b)
-{
-	return !(a->len == b->len && !strncmp(a->s, b->s, a->len));
-}
-
-static inline int str_i_cmp(const str *a, const str *b)
-{
-	return !(a->len == b->len && !strncasecmp(a->s, b->s, a->len));
-}
-
 /**
  * converts a mapped str to an int
  * \return	0 if found, -1 otherwise
@@ -115,7 +105,7 @@ static inline int str_i_cmp(const str *a, const str *b)
 static inline int str_map_str(const str_map_t *map, const str *key, int *ret)
 {
 	for(; map->str.s; map++)
-		if(!str_i_cmp(&map->str, key)) {
+		if(!str_strcasecmp(&map->str, key)) {
 			*ret = map->id;
 			return 0;
 		}