[PATCH] Libnet vampire for Schema refactored to perform multi-pass Schema resolving
abartlet at samba.org
Sun Sep 26 15:44:30 MDT 2010
On Sat, 2010-09-25 at 13:36 +0300, Kamen Mazdrashki wrote:
> Hi Andrew,
> Here is a version with approach that doesn't need memmoving objects
> back and forth.
> Please push if you are happy with it.
> The only thing I'm worried is that it is isn't clear as 'memmove()'
> As I said, 'memmove()' approach is all around Samba and people are used to
> it :)
I've thought about this again, and I've come up with a different idea.
Indeed, it is less clear - and I wouldn't suggest this approach either.
One of the things that I don't understand looking at the final code,
rather than the patch, is that you are walking over the whole schema,
but you don't remove elements that pass - instead you store them, to
convert them into the schema again?
Your previous code did remove them from the list.
What we need here is a different data structure - an array is the wrong
structure, which is why this is so difficult.
Instead, we should define a linked list, instead of assigning the
elements into the array at the start. That way, you can walk over the
whole linked list, and remove elements in O(1) time. (use the DLINK_
Andrew Bartlett http://samba.org/~abartlet/
Authentication Developer, Samba Team http://samba.org
Samba Developer, Cisco Inc.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 190 bytes
Desc: This is a digitally signed message part
More information about the samba-technical