summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid McMackins II <contact@mcmackins.org>2015-10-04 15:35:30 -0500
committerDavid McMackins II <contact@mcmackins.org>2015-10-04 15:35:30 -0500
commit40673b089fd3b9f70bfbb50e790b989a752b958d (patch)
treecaaf42c46c9ef55b73b64e3a3420531ef64e429d
parentbc42b25bc327edbce3487864b87a533ae9263135 (diff)
Remove redundant child location code
-rw-r--r--pfxtree.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/pfxtree.c b/pfxtree.c
index 190b226..f58d1ae 100644
--- a/pfxtree.c
+++ b/pfxtree.c
@@ -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;