~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/xml8.py

  • Committer: John Arbash Meinel
  • Date: 2009-12-01 21:27:08 UTC
  • mto: This revision was merged to the branch mainline in revision 4887.
  • Revision ID: john@arbash-meinel.com-20091201212708-bjlq7ydk7xtmzuhd
Add a flag that controls if we will return InventoryEntries from the cache.

Setting this to true makes conversion a lot faster, but isn't safe to do
all the time, as callers might mutate the returned object.

Show diffs side-by-side

added added

removed removed

Lines of Context:
433
433
                pass
434
434
            else:
435
435
                # Only copying directory entries drops us 2.85s => 2.35s
436
 
                # if cached_ie.kind == 'directory':
437
 
                #     return cached_ie.copy()
438
 
                # return cached_ie
 
436
                if self.safe_to_use_cache_items:
 
437
                    if cached_ie.kind == 'directory':
 
438
                        return cached_ie.copy()
 
439
                    return cached_ie
439
440
                return cached_ie.copy()
440
441
 
441
442
        kind = elt.tag