On Sun, Aug 22, 2010 at 10:02, Jelmer Vernooij <[email protected]> wrote:
> On Wed, 2010-08-18 at 09:41 -0700, [email protected] wrote: > > From: Dave Borowitz <[email protected]> > > > > Change-Id: I06fe864a6a89d1b77cffd13aac790c15b64224ff > > --- > > NEWS | 2 ++ > > dulwich/object_store.py | 13 +++++++++---- > > 2 files changed, 11 insertions(+), 4 deletions(-) > > > > diff --git a/NEWS b/NEWS > > index 14cb030..75fe560 100644 > > --- a/NEWS > > +++ b/NEWS > > @@ -50,6 +50,8 @@ > > * Use real in-memory objects rather than stubs for server tests. > > (Dave Borowitz) > > > > + * Clean up MissingObjectFinder. (Dave Borowitz) > > + > > API CHANGES > > > > * ObjectStore.iter_tree_contents now walks contents in depth-first, > sorted > > diff --git a/dulwich/object_store.py b/dulwich/object_store.py > > index 61192d7..162f102 100644 > > --- a/dulwich/object_store.py > > +++ b/dulwich/object_store.py > > @@ -711,8 +711,10 @@ class MissingObjectFinder(object): > > > > def __init__(self, object_store, haves, wants, progress=None, > > get_tagged=None): > > - self.sha_done = set(haves) > > - self.objects_to_send = set([(w, None, False) for w in wants if w > not in haves]) > > + haves = set(haves) > > + self.sha_done = haves > I have concerns about setting sha_done to haves here without copying it. > It means we'll end up modifying the set that is being passed in by the > caller whereas we previously werent. > The previous line (haves = set(haves)) still copies it. I just stored it in a local to make the list comprehension faster. > Cheers, > > Jelmer >
_______________________________________________ Mailing list: https://launchpad.net/~dulwich-users Post to : [email protected] Unsubscribe : https://launchpad.net/~dulwich-users More help : https://help.launchpad.net/ListHelp

