Re: [PATCH] Add dirs to subject of mailer.py
From: Greg Stein <gstein_at_lyra.org>
Date: 2003-01-13 13:47:24 CET
On Sun, Jan 12, 2003 at 09:43:36PM -0000, Chris Foote wrote:
Grr... I didn't see this until after I wrote the same thing :-(
For future reference, though, I can provide some feedback on this patch. In
>...
This re.sub() is way more expensive than simply testing the last character
if fname != '/' and fname[-1] == '/':
(prolly still gotta watch out for the empty string; that is actually the
> + if fname not in dirschanged:
oof. To generate a set of unique items in Python, it will be much faster to
dirschanged = { }
Then, to get the list:
dirschange = dirschanged.keys()
> + dirschanged.sort()
I did the same pop(), but it doesn't matter which end the thing comes from,
> + commonpieces = firstline.split('/')
This algorithm, which svnlook uses, too, doesn't quite work right. If
Note that I did:
del commonpieces[i:]
That modifies the list in place rather than copying.
> +
I didn't bother to save firstline, and just rebuilt the dirschanged from the
> + if len(commonpieces):
Faster/easier to use string slices here.
I definitely appreciate you taking the time to develop the patch! Stupid
Thanks!
Cheers,
-- Greg Stein, http://www.lyra.org/ --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org For additional commands, e-mail: dev-help@subversion.tigris.orgReceived on Mon Jan 13 13:46:01 2003 |
This is an archived mail posted to the Subversion Dev mailing list.
This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.