s4:partition LDB module - "partition_sequence_number" - remove meaningless "if"s
authorMatthias Dieter Wallnöfer <mdw@samba.org>
Sat, 5 Mar 2011 18:02:43 +0000 (19:02 +0100)
committerMatthias Dieter Wallnöfer <mdw@samba.org>
Thu, 10 Mar 2011 10:12:05 +0000 (11:12 +0100)
These current partition controls are always added for the two EXOP operations.

source4/dsdb/samdb/ldb_modules/partition.c

index 6cf670937e60c5207d83becf01be7a2ecd1c154b..286733119b89be53c0c6e8d043603569161c57b4 100644 (file)
@@ -983,14 +983,12 @@ static int partition_sequence_number(struct ldb_module *module, struct ldb_reque
                                return ret;
                        }
 
-                       if (!ldb_request_get_control(treq, DSDB_CONTROL_CURRENT_PARTITION_OID)) {
-                               ret = ldb_request_add_control(treq,
-                                                             DSDB_CONTROL_CURRENT_PARTITION_OID,
-                                                             false, data->partitions[i]->ctrl);
-                               if (ret != LDB_SUCCESS) {
-                                       talloc_free(res);
-                                       return ret;
-                               }
+                       ret = ldb_request_add_control(treq,
+                                                     DSDB_CONTROL_CURRENT_PARTITION_OID,
+                                                     false, data->partitions[i]->ctrl);
+                       if (ret != LDB_SUCCESS) {
+                               talloc_free(res);
+                               return ret;
                        }
 
                        ret = partition_request(data->partitions[i]->module, treq);
@@ -1086,14 +1084,12 @@ static int partition_sequence_number(struct ldb_module *module, struct ldb_reque
                                return ret;
                        }
 
-                       if (!ldb_request_get_control(treq, DSDB_CONTROL_CURRENT_PARTITION_OID)) {
-                               ret = ldb_request_add_control(treq,
-                                                             DSDB_CONTROL_CURRENT_PARTITION_OID,
-                                                             false, data->partitions[i]->ctrl);
-                               if (ret != LDB_SUCCESS) {
-                                       talloc_free(res);
-                                       return ret;
-                               }
+                       ret = ldb_request_add_control(treq,
+                                                     DSDB_CONTROL_CURRENT_PARTITION_OID,
+                                                     false, data->partitions[i]->ctrl);
+                       if (ret != LDB_SUCCESS) {
+                               talloc_free(res);
+                               return ret;
                        }
 
                        ret = partition_request(data->partitions[i]->module, treq);