1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-11-04 08:17:17 -05:00

get_child_dom_select_node(): Use the foreach_dom_node iterator

This commit is contained in:
Jonas Fonseca 2005-12-20 01:48:21 +01:00 committed by Jonas Fonseca
parent ceffe8f1a4
commit c2e30c8eea

View File

@ -553,15 +553,14 @@ get_child_dom_select_node(struct dom_select_node *selector,
enum dom_node_type type) enum dom_node_type type)
{ {
struct dom_node_list *children = selector->node.data.element.children; struct dom_node_list *children = selector->node.data.element.children;
size_t index; struct dom_node *node;
int index;
if (!children) if (!children)
return NULL; return NULL;
for (index = 0; is_dom_node_list_member(children, index); index++) { foreach_dom_node (children, node, index) {
struct dom_node *node = children->entries[index]; if (node->type == type)
if (node && node->type == type)
return (struct dom_select_node *) node; return (struct dom_select_node *) node;
} }