diff options
author | David McMackins II <contact@mcmackins.org> | 2015-10-04 15:35:30 -0500 |
---|---|---|
committer | David McMackins II <contact@mcmackins.org> | 2015-10-04 15:35:30 -0500 |
commit | 40673b089fd3b9f70bfbb50e790b989a752b958d (patch) | |
tree | caaf42c46c9ef55b73b64e3a3420531ef64e429d | |
parent | bc42b25bc327edbce3487864b87a533ae9263135 (diff) |
Remove redundant child location code
-rw-r--r-- | pfxtree.c | 14 |
1 files changed, 1 insertions, 13 deletions
@@ -176,19 +176,7 @@ pt_search (const PrefixTree *root, const char *word) for (i = 0; i <= len; ++i) { - PrefixTree *child; - pt_child_foreach (node, child) - { - if (word[i] == child->ch) - { - node = child; - break; - } - else if (NULL == child->next) - { - node = NULL; - } - } + node = get_child_by_ch (node, word[i]); if (NULL == node) return NULL; |