summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-10-15 11:38:35 -0700
committerZac Medico <zmedico@gentoo.org>2011-10-15 11:38:35 -0700
commitf4807e05962845c17d689b8bb80a1f55b85834c9 (patch)
tree472bfe76e953f5d02b36588f75a73a3eb36ccc2a /pym
parentc6cd30c6165d39bf3cd040b3dc29bfec4323bbf2 (diff)
downloadportage-f4807e05962845c17d689b8bb80a1f55b85834c9.tar.gz
portage-f4807e05962845c17d689b8bb80a1f55b85834c9.tar.bz2
portage-f4807e05962845c17d689b8bb80a1f55b85834c9.zip
frozenset categories optimize pordbapi.cp_list()
Diffstat (limited to 'pym')
-rw-r--r--pym/portage/package/ebuild/config.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py
index 37dcbb4cf..a80c82dd5 100644
--- a/pym/portage/package/ebuild/config.py
+++ b/pym/portage/package/ebuild/config.py
@@ -606,9 +606,11 @@ class config(object):
self.categories = [grabfile(os.path.join(x, "categories")) \
for x in locations_manager.profile_and_user_locations]
category_re = dbapi._category_re
- self.categories = tuple(sorted(
+ # categories used to be a tuple, but now we use a frozenset
+ # for hashed category validation in pordbapi.cp_list()
+ self.categories = frozenset(
x for x in stack_lists(self.categories, incremental=1)
- if category_re.match(x) is not None))
+ if category_re.match(x) is not None)
archlist = [grabfile(os.path.join(x, "arch.list")) \
for x in locations_manager.profile_and_user_locations]