diff options
author | Andrew Tridgell <tridge@samba.org> | 2010-02-10 15:53:58 -0800 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2010-02-10 15:53:58 -0800 |
commit | 32809bd8c17c9c522338722177539aa3d60c4cbc (patch) | |
tree | ab1dd87ebbb38226b0a47f0e39eef15a58a24001 /source4/dsdb | |
parent | 13ac4ad52187df7093904d4ad9c47d51bd1eda6f (diff) | |
download | samba-32809bd8c17c9c522338722177539aa3d60c4cbc.tar.gz samba-32809bd8c17c9c522338722177539aa3d60c4cbc.tar.bz2 samba-32809bd8c17c9c522338722177539aa3d60c4cbc.zip |
util: rewrite dlinklist.h so that DLIST_ADD_END() is O(1)
This changes the meaning of the ->prev pointer in our doubly linked
lists to point at the end of the list from the front of the list. That
allows us to implement DLIST_ADD_END() and related functions in O(1)
time, which can be a huge saving in many places in Samba.
This also means that the 'type' argument to various DLIST_*() macros
is no longer needed, but I have left it in for now to keep the
patchset small, which will make it easier to revert if any problems
are found. In the future we should remove the 'type' arguments.
(jra. Move the one use of DLIST_TAIL over to the new macros).
Diffstat (limited to 'source4/dsdb')
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/repl_meta_data.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c index e64d51aad0..67d7094d4c 100644 --- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c +++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c @@ -3783,8 +3783,7 @@ static int replmd_prepare_commit(struct ldb_module *module) /* walk the list backwards, to do the first entry first, as we * added the entries with DLIST_ADD() which puts them at the * start of the list */ - DLIST_TAIL(replmd_private->la_list,la); - for (; la; la=prev) { + for (la = DLIST_TAIL(replmd_private->la_list); la; la=prev) { prev = DLIST_PREV(la); DLIST_REMOVE(replmd_private->la_list, la); ret = replmd_process_linked_attribute(module, la); |