Skip to content

Commit

Permalink
core: remove a useless check in find_same_type()
Browse files Browse the repository at this point in the history
The caller already does it.

Signed-off-by: Brice Goglin <Brice.Goglin@inria.fr>
  • Loading branch information
bgoglin committed Sep 14, 2018
1 parent 87c68fd commit 5738ac4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions hwloc/topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -2583,19 +2583,19 @@ hwloc_connect_children(hwloc_obj_t parent)
}

/*
* Check whether there is an object below ROOT that has the same type as OBJ
* Check whether there is an object strictly below ROOT that has the same type as OBJ
*/
static int
find_same_type(hwloc_obj_t root, hwloc_obj_t obj)
{
hwloc_obj_t child;

if (hwloc_type_cmp(root, obj) == HWLOC_OBJ_EQUAL)
return 1;

for_each_child (child, root)
for_each_child (child, root) {
if (hwloc_type_cmp(child, obj) == HWLOC_OBJ_EQUAL)
return 1;
if (find_same_type(child, obj))
return 1;
}

return 0;
}
Expand Down

0 comments on commit 5738ac4

Please sign in to comment.