summaryrefslogtreecommitdiff
path: root/libcli
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2013-01-03 21:30:12 +1100
committerStefan Metzmacher <metze@samba.org>2013-01-21 16:12:45 +0100
commitd36c03056fb85dfedbafd3a59497e35db63ade17 (patch)
treec77b6e3df1153849241e95f9c70f630c1b8cf353 /libcli
parent853ecd418afe15973d3e8844ad0e01d3d54536d5 (diff)
downloadsamba-d36c03056fb85dfedbafd3a59497e35db63ade17.tar.gz
samba-d36c03056fb85dfedbafd3a59497e35db63ade17.tar.bz2
samba-d36c03056fb85dfedbafd3a59497e35db63ade17.zip
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>
Diffstat (limited to 'libcli')
-rw-r--r--libcli/security/object_tree.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/libcli/security/object_tree.c b/libcli/security/object_tree.c
index fb523be4a5..3e5ee10951 100644
--- a/libcli/security/object_tree.c
+++ b/libcli/security/object_tree.c
@@ -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);
}
}