mirror of
https://github.com/samba-team/samba.git
synced 2024-12-24 21:34:56 +03:00
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.
This commit is contained in:
parent
12f689eef4
commit
ff8ad222cd
@ -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");
|
||||
|
@ -555,7 +555,7 @@ WERROR dsdb_set_schema_from_ldif(struct ldb_context *ldb, const char *pf, const
|
||||
goto failed;
|
||||
}
|
||||
|
||||
DLIST_ADD_END(schema->attributes, sa, struct dsdb_attribute *);
|
||||
DLIST_ADD(schema->attributes, sa);
|
||||
} else if (is_sc) {
|
||||
struct dsdb_class *sc;
|
||||
|
||||
@ -569,7 +569,7 @@ WERROR dsdb_set_schema_from_ldif(struct ldb_context *ldb, const char *pf, const
|
||||
goto failed;
|
||||
}
|
||||
|
||||
DLIST_ADD_END(schema->classes, sc, struct dsdb_class *);
|
||||
DLIST_ADD(schema->classes, sc);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user