Mark Grosberg wrote:
>On Fri, 9 May 2003, [UTF-8] Branko Čibej wrote:
>>Apart from several stylistic nits (such as aligning the function param
>>names; we don't do that) and missing docstrings for the new functions,
>I'll fix those. Where are the doc strings? I didn't see any as I don't
>think I've changed any public interfaces.
Every function, even static functions, have comments explaingin what
they do, and the use of the parameters, at the beginning. Look at the
existing code, you're bound to find some.
>>it strikes me that you're complicating things enormously, *and* you
>>introduced a quadratic algorithm for tagging the array.
Why what? :-)
>As for the algorithm on the array, I thought about using a hash. But I
>figured that would waste memory. Usually the list of comitted files isn't
>that large that it would matter.
It wouldn't use that much more memory; you don't have to copy the
strings anywhere, just terminate them in-place (you'll be throwing away
that part of the log anyway). So you'd only be using extra memory for
the has structure itself; not much.
And using the phrase "usually the list isn't that large" as an argument
_for_ a quadratic algorithm makes my hair stand on end. I've heard it so
>But I'll do it and submit another patch and see how it works. Should I
>make a subpool for the hash or just use the pool passed in to the log
Since the log getter's pool gets thrown away after the commit, you don't
gain anything by using a subpool.
>>You can make things much simpler by just parsing the list in the log
>>file into a hash table keyed off the path (only the existence of the key
>>is important), then use lookups into the table to set the UNMARKED flag.
>I guess I have to learn how APR hashes work now....
>>That way you only need a single traverse throught the array to set all
>>flags correctly, and you don't need a reference to the array in
>I still think I would need to pass the array.
What I meant was, you can split the thing into two functions: one that
parses the log and creates the hash table, and another one that tags the
array. It's always nice to separate things that way.
Brane Čibej <brane_at_xbc.nu> http://www.xbc.nu/brane/
To unsubscribe, e-mail: firstname.lastname@example.org
For additional commands, e-mail: email@example.com
Received on Fri May 9 02:37:21 2003