From: Zac Medico Date: Sun, 31 Oct 2010 18:15:00 +0000 (-0700) Subject: Optimize LazyItemsDict.__deepcopy__(). X-Git-Tag: v2.1.9.24 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=bbce62ccae17b6db10ecd99e76589b7174f63f55;p=portage.git Optimize LazyItemsDict.__deepcopy__(). --- diff --git a/pym/portage/util/__init__.py b/pym/portage/util/__init__.py index b7a6ed133..6c39f8952 100644 --- a/pym/portage/util/__init__.py +++ b/pym/portage/util/__init__.py @@ -1299,8 +1299,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 " + \