dsdb: Remove redundant variable/check
authorTim Beale <timbeale@catalyst.net.nz>
Fri, 28 Sep 2018 02:55:14 +0000 (14:55 +1200)
committerDouglas Bagnall <dbagnall@samba.org>
Fri, 12 Oct 2018 02:16:22 +0000 (04:16 +0200)
Previously, this code used to live inside the loop, so the
checked_reveal_control was needed to save ourselves unnecessary work.

However, now that the code has been moved outside the loop, the
checked_reveal_control variable is just unnecessary complication.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
source4/dsdb/samdb/ldb_modules/extended_dn_out.c

index 6a869d0c4820668520b3e5c05898d7e9d55d1774..feb0bf4058f9a3dc90a097a5ba7e87b110778d50 100644 (file)
@@ -402,7 +402,7 @@ static int extended_callback(struct ldb_request *req, struct ldb_reply *ares,
        struct ldb_message *msg;
        struct extended_dn_out_private *p;
        struct ldb_context *ldb;
-       bool have_reveal_control=false, checked_reveal_control=false;
+       bool have_reveal_control=false;
 
        ac = talloc_get_type(req->context, struct extended_search_context);
        p = talloc_get_type(ldb_module_get_private(ac->module), struct extended_dn_out_private);
@@ -473,11 +473,9 @@ static int extended_callback(struct ldb_request *req, struct ldb_reply *ares,
                }
        }
 
-       if (!checked_reveal_control) {
-               have_reveal_control =
-                       ldb_request_get_control(req, LDB_CONTROL_REVEAL_INTERNALS) != NULL;
-               checked_reveal_control = true;
-       }
+       have_reveal_control =
+               ldb_request_get_control(req,
+                                       LDB_CONTROL_REVEAL_INTERNALS) != NULL;
 
        /* 
         * Shortcut for repl_meta_data.  We asked for the data