From c2e30c8eeaa5475bac1fef79a3caa3d47fffeb00 Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Tue, 20 Dec 2005 01:48:21 +0100 Subject: [PATCH] get_child_dom_select_node(): Use the foreach_dom_node iterator --- src/document/dom/select.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/document/dom/select.c b/src/document/dom/select.c index 94f46e52..58cb5f14 100644 --- a/src/document/dom/select.c +++ b/src/document/dom/select.c @@ -553,15 +553,14 @@ get_child_dom_select_node(struct dom_select_node *selector, enum dom_node_type type) { struct dom_node_list *children = selector->node.data.element.children; - size_t index; + struct dom_node *node; + int index; if (!children) return NULL; - for (index = 0; is_dom_node_list_member(children, index); index++) { - struct dom_node *node = children->entries[index]; - - if (node && node->type == type) + foreach_dom_node (children, node, index) { + if (node->type == type) return (struct dom_select_node *) node; }