diff --git a/include/r3_str.h b/include/r3_str.h index 454ae8e..8da66fa 100644 --- a/include/r3_str.h +++ b/include/r3_str.h @@ -10,10 +10,6 @@ #include "r3_define.h" #include "config.h" -int strndiff(char * d1, char * d2, unsigned int n); - -int strdiff(char * d1, char * d2); - int slug_count(char * p, int len); char * compile_slug(char * str, int len); diff --git a/src/node.c b/src/node.c index c592021..e278e1f 100644 --- a/src/node.c +++ b/src/node.c @@ -18,9 +18,28 @@ #include "r3.h" #include "str_array.h" - // String value as the index http://judy.sourceforge.net/doc/JudySL_3x.htm + +static int strndiff(char * d1, char * d2, unsigned int n) { + char * o = d1; + while ( *d1 == *d2 && n-- > 0 ) { + d1++; + d2++; + } + return d1 - o; +} + +static int strdiff(char * d1, char * d2) { + char * o = d1; + while( *d1 == *d2 ) { + d1++; + d2++; + } + return d1 - o; +} + + /** * Create a node object */ diff --git a/src/str.c b/src/str.c index 124e1d2..814a012 100644 --- a/src/str.c +++ b/src/str.c @@ -12,26 +12,6 @@ #include "str_array.h" #include "r3_define.h" -int strndiff(char * d1, char * d2, unsigned int n) { - char * o = d1; - while ( *d1 == *d2 && n-- > 0 ) { - d1++; - d2++; - } - return d1 - o; -} - - -int strdiff(char * d1, char * d2) { - char * o = d1; - while( *d1 == *d2 ) { - d1++; - d2++; - } - return d1 - o; -} - - /** * provide a quick way to count slugs, simply search for '{' */ diff --git a/tests/bench_str.csv b/tests/bench_str.csv index ab5cfe9..f06c833 100644 --- a/tests/bench_str.csv +++ b/tests/bench_str.csv @@ -384,3 +384,4 @@ 1400593197,13978543.79 1400593210,13568445.16 1400593219,13704926.07 +1400599508,13991454.07