1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-22 22:04:08 +03:00

libcli/security: remove useless if (root->num_of_children > 0) statements

The for loop does this implicitly when comparing for (i = 0; i < root->num_of_children; i++)

Andrew Bartlett

Reviewed-by: Stefan Metzmacher <metze@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Andrew Bartlett 2013-01-03 21:30:12 +11:00 committed by Stefan Metzmacher
parent 853ecd418a
commit d36c03056f

View File

@ -97,11 +97,9 @@ struct object_tree *get_object_tree_by_GUID(struct object_tree *root,
result = root;
return result;
}
else if (root->num_of_children > 0) {
for (i = 0; i < root->num_of_children; i++) {
for (i = 0; i < root->num_of_children; i++) {
if ((result = get_object_tree_by_GUID(&root->children[i], guid)))
break;
}
}
return result;
}
@ -111,11 +109,9 @@ struct object_tree *get_object_tree_by_GUID(struct object_tree *root,
void object_tree_modify_access(struct object_tree *root,
uint32_t access_mask)
{
int i;
root->remaining_access &= ~access_mask;
if (root->num_of_children > 0) {
int i;
for (i = 0; i < root->num_of_children; i++) {
object_tree_modify_access(&root->children[i], access_mask);
}
for (i = 0; i < root->num_of_children; i++) {
object_tree_modify_access(&root->children[i], access_mask);
}
}