summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb/ldb_modules
diff options
context:
space:
mode:
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>2019-05-01 10:35:46 +1200
committerAndrew Bartlett <abartlet@samba.org>2019-05-01 03:12:07 +0000
commit8488651bdd6e36252bd2edde4683fd0c5c998fe2 (patch)
treea8ae68aee9af4d62648785d892d55ddf66c11e8d /source4/dsdb/samdb/ldb_modules
parent5ac626e7b0565bf880d1b18a3b414bc67d8606df (diff)
downloadsamba-8488651bdd6e36252bd2edde4683fd0c5c998fe2.tar.gz
s4/replmd: delete checks flag before laborious search
Most (perhaps all) attributes that are in the "must not remove" list also have the PRESERVEONDELETE bit set, and checking bits is much cheaper than a linear search involving strcasecmp. If we check the bit first we save work. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules')
-rw-r--r--source4/dsdb/samdb/ldb_modules/repl_meta_data.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
index 7440e9b50f1..1b080137a2e 100644
--- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
+++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
@@ -4612,10 +4612,10 @@ static int replmd_delete_internals(struct ldb_module *module, struct ldb_request
dsdb_flags |= DSDB_REPLMD_VANISH_LINKS;
} else if (sa->linkID == 0) {
- if (ldb_attr_in_list(preserved_attrs, el->name)) {
+ if (sa->searchFlags & SEARCH_FLAG_PRESERVEONDELETE) {
continue;
}
- if (sa->searchFlags & SEARCH_FLAG_PRESERVEONDELETE) {
+ if (ldb_attr_in_list(preserved_attrs, el->name)) {
continue;
}
} else {