dsdb-operational: Avoid doing the ldb_attr_cmp if bypass flag is not set
authorMatthieu Patou <mat@matws.net>
Thu, 27 Dec 2012 08:01:49 +0000 (00:01 -0800)
committerStefan Metzmacher <metze@samba.org>
Thu, 17 Jan 2013 16:10:32 +0000 (17:10 +0100)
Most of the time this flag is not set and so we can avoid the strcasecmp
in ldb_attr_cmp()

Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Jan 17 17:10:32 CET 2013 on sn-devel-104

source4/dsdb/samdb/ldb_modules/operational.c

index c642ad8c928e4b50733d1e35f31b5f1e3f7e8211..b1122b3d4294ea2092938e0c54682c290522c670 100644 (file)
@@ -612,7 +612,7 @@ struct op_controls_flags {
 };
 
 static bool check_keep_control_for_attribute(struct op_controls_flags* controls_flags, const char* attr) {
-       if (ldb_attr_cmp(attr, "msDS-KeyVersionNumber") == 0 && controls_flags->bypassoperational) {
+       if (controls_flags->bypassoperational && ldb_attr_cmp(attr, "msDS-KeyVersionNumber") == 0 ) {
                return true;
        }
        return false;