macro rename

This commit is contained in:
c9s 2014-06-10 20:18:59 +08:00
parent 7f8684d808
commit 2c5f135600
2 changed files with 4 additions and 4 deletions

View file

@ -59,8 +59,8 @@ struct _node {
void * data;
};
#define node_edge_pattern(node,i) node->edges[i]->pattern
#define node_edge_pattern_len(node,i) node->edges[i]->pattern_len
#define r3_node_edge_pattern(node,i) node->edges[i]->pattern
#define r3_node_edge_pattern_len(node,i) node->edges[i]->pattern_len
struct _edge {
char * pattern; // 8 bytes

View file

@ -443,8 +443,8 @@ inline edge * r3_node_find_edge_str(const node * n, const char * str, int str_le
unsigned int i;
for (i = n->edge_len; i--; ) {
if ( firstbyte == *(n->edges[i]->pattern) ) {
info("matching '%s' with '%s'\n", str, node_edge_pattern(n,i) );
if ( strncmp( node_edge_pattern(n,i), str, node_edge_pattern_len(n,i) ) == 0 ) {
info("matching '%s' with '%s'\n", str, r3_node_edge_pattern(n,i) );
if ( strncmp( r3_node_edge_pattern(n,i), str, r3_node_edge_pattern_len(n,i) ) == 0 ) {
return n->edges[i];
}
return NULL;