diff options
author | Matthias Dieter Wallnöfer <mdw@samba.org> | 2011-10-12 09:29:08 +0200 |
---|---|---|
committer | Matthias Dieter Wallnöfer <mdw@samba.org> | 2011-10-27 18:52:29 +0200 |
commit | 730257f4c0ef0df4c30150d956dbf319c3d5aedc (patch) | |
tree | 0e70788b1160e1e0c0f337b3d6945ebc6fd1a2a7 /source4 | |
parent | 82d9c9e5a0640fbe6871785a1672895d35630996 (diff) | |
download | samba-730257f4c0ef0df4c30150d956dbf319c3d5aedc.tar.gz samba-730257f4c0ef0df4c30150d956dbf319c3d5aedc.tar.bz2 samba-730257f4c0ef0df4c30150d956dbf319c3d5aedc.zip |
s4:objectclass LDB module - "objectclass_add" - small optimisation
This saves us from doing one "ldb_msg_find_element".
Reviewed-by: abartlet
Diffstat (limited to 'source4')
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/objectclass.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/objectclass.c b/source4/dsdb/samdb/ldb_modules/objectclass.c index 5c89371216..6e087b9897 100644 --- a/source4/dsdb/samdb/ldb_modules/objectclass.c +++ b/source4/dsdb/samdb/ldb_modules/objectclass.c @@ -555,7 +555,8 @@ static int objectclass_do_add(struct oc_context *ac) /* We must completely replace the existing objectClass entry, * because we need it sorted. */ - ret = ldb_msg_add_empty(msg, "objectClass", 0, NULL); + ret = ldb_msg_add_empty(msg, "objectClass", 0, + &objectclass_element); if (ret != LDB_SUCCESS) { talloc_free(mem_ctx); return ret; @@ -577,9 +578,6 @@ static int objectclass_do_add(struct oc_context *ac) talloc_free(mem_ctx); - /* Retrive the message again so get_last_structural_class works */ - objectclass_element = ldb_msg_find_element(msg, "objectClass"); - /* Make sure its valid to add an object of this type */ objectclass = get_last_structural_class(ac->schema, objectclass_element, ac->req); |