summaryrefslogtreecommitdiff
path: root/source4/dsdb/schema/schema_init.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2009-09-15 10:01:26 -0700
committerAndrew Tridgell <tridge@samba.org>2009-09-15 18:45:42 -0700
commitff8ad222cd1ec26f0e29e409525e16d3b0f1b8c4 (patch)
tree46f11080152feb241e3face925d2b404abfc3be8 /source4/dsdb/schema/schema_init.c
parent12f689eef4394e8c2cf8efdded06d5b398d6e0a7 (diff)
downloadsamba-ff8ad222cd1ec26f0e29e409525e16d3b0f1b8c4.tar.gz
samba-ff8ad222cd1ec26f0e29e409525e16d3b0f1b8c4.tar.bz2
samba-ff8ad222cd1ec26f0e29e409525e16d3b0f1b8c4.zip
s4-dsdb: use DLIST_ADD() not DLIST_ADD_END()
Using DLIST_ADD_END() to construct a long list is very inefficient (it is O(n^2). These lists are not ordered, so using DLIST_ADD() is much better.
Diffstat (limited to 'source4/dsdb/schema/schema_init.c')
-rw-r--r--source4/dsdb/schema/schema_init.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source4/dsdb/schema/schema_init.c b/source4/dsdb/schema/schema_init.c
index 3b701ad31c..9f7d967158 100644
--- a/source4/dsdb/schema/schema_init.c
+++ b/source4/dsdb/schema/schema_init.c
@@ -967,7 +967,7 @@ int dsdb_schema_from_ldb_results(TALLOC_CTX *mem_ctx, struct ldb_context *ldb,
return LDB_ERR_CONSTRAINT_VIOLATION;
}
- DLIST_ADD_END(schema->attributes, sa, struct dsdb_attribute *);
+ DLIST_ADD(schema->attributes, sa);
}
for (i=0; i < objectclass_res->count; i++) {
@@ -988,7 +988,7 @@ int dsdb_schema_from_ldb_results(TALLOC_CTX *mem_ctx, struct ldb_context *ldb,
return LDB_ERR_CONSTRAINT_VIOLATION;
}
- DLIST_ADD_END(schema->classes, sc, struct dsdb_class *);
+ DLIST_ADD(schema->classes, sc);
}
schema->fsmo.master_dn = ldb_msg_find_attr_as_dn(ldb, schema, schema_res->msgs[0], "fSMORoleOwner");