[MERGE] Fix for poor bzr rm * performance in trunk
Johan Walles
johan.walles at gmail.com
Thu May 7 06:13:53 BST 2009
Here you go. NEWS item moved, and I re-wrote the loop a bit as well.
Cheers //Johan
2009/5/6 Ian Clatworthy <ian.clatworthy at internode.on.net>:
> Johan Walles wrote:
>> Here's an updated patch with the following new changes in it:
>> * Existing unit test updated.
>> * The resulting test failure fixed.
>> * Updated the NEWS file.
>
> Thanks. This is really close now IMO.
>
> bb:tweak
>
> I'd like 2 changes made:
>
> 1. As we're not actually fixing a logic bug, I'd like the
> NEWS item added (alphabetically) under Improvements instead of Bugs.
>
> 2. I think we can simplify this code further ...
>
>> + for path in sorted_paths:
>> + if len(search_paths) == 0:
>> + # Result is empty, add first path
>> + search_paths.append(path)
>> + continue
>> + if not is_inside(search_paths[-1], path):
>> + # This path is unique, add it
>> + search_paths.append(path)
>> + continue
>
> into something like ...
>
> search_paths = [sorted_paths[0]]
> for path in sorted_paths[1:]:
> if not is_inside(search_paths[-1], path):
> ...
>
> You don't need the closing continue either. Oh, and as the above code
> I'm proposing assumes that there is at least 1 item in sorted_paths, we
> need a test right at the top of the routine something like ...
>
> if not paths:
> return set()
>
> Make sense?
>
> Ian C.
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bzr-quick-rm-star.patch
Type: text/x-diff
Size: 18909 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20090507/ce7e8342/attachment-0001.bin
More information about the bazaar
mailing list