From 8fa5e567e76d4edb818d4cd88886918470d78ad1 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 15 Sep 2009 10:01:26 -0700 Subject: 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. --- source4/dsdb/schema/schema_init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/dsdb/schema/schema_init.c') 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"); -- cgit