diff --git a/src/node.c b/src/node.c index 000df5f..7085e29 100644 --- a/src/node.c +++ b/src/node.c @@ -345,9 +345,9 @@ route * r3_tree_match_route(node *tree, match_entry * entry) { inline edge * r3_node_find_edge_str(node * n, char * str, int str_len) { int i = 0; int matched_idx = 0; - + char firstbyte = *str; for (; i < n->edge_len ; i++ ) { - if ( *str == *(n->edges[i]->pattern) ) { + if ( firstbyte == *(n->edges[i]->pattern) ) { matched_idx = i; break; } diff --git a/tests/bench_str.csv b/tests/bench_str.csv index c565e8c..40dc980 100644 --- a/tests/bench_str.csv +++ b/tests/bench_str.csv @@ -423,3 +423,8 @@ 1400605834,13635682.11 1400606038,13788132.68 1400606140,13834040.49 +1400606400,13665833.66 +1400606404,13519944.18 +1400606406,13923000.83 +1400606409,13742645.62 +1400606411,13878225.03