From: Zac Medico Date: Sun, 31 Oct 2010 18:15:00 +0000 (-0700) Subject: Optimize LazyItemsDict.__deepcopy__(). X-Git-Tag: v2.2.0_alpha3 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6ef9ca0940e15fff9862eacb17e81021a31074aa;p=portage.git Optimize LazyItemsDict.__deepcopy__(). --- diff --git a/pym/portage/util/__init__.py b/pym/portage/util/__init__.py index b6f0ae2e3..dacbcebc6 100644 --- a/pym/portage/util/__init__.py +++ b/pym/portage/util/__init__.py @@ -1326,8 +1326,8 @@ class LazyItemsDict(UserDict): memo[id(self)] = result for k in self: k_copy = deepcopy(k, memo) - if k in self.lazy_items: - lazy_item = self.lazy_items[k] + lazy_item = self.lazy_items.get(k) + if lazy_item is not None: if not lazy_item.singleton: raise TypeError(_unicode_decode("LazyItemsDict " + \ "deepcopy is unsafe with lazy items that are " + \