From b2bb670b019ad5e15097578bec75ea36ff5586d6 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 10 Dec 2006 11:41:17 +0000 Subject: [PATCH] To minimize memory consumption and maximize performance, use hash values for cache keys. svn path=/main/trunk/; revision=5260 --- pym/portage_dep.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pym/portage_dep.py b/pym/portage_dep.py index d665507a6..5eacb8368 100644 --- a/pym/portage_dep.py +++ b/pym/portage_dep.py @@ -501,7 +501,8 @@ def match_from_list(mydep, candidate_list): """ global _match_from_list_cache - mylist = _match_from_list_cache.get((mydep, tuple(candidate_list)), None) + mylist = _match_from_list_cache.get( + hash((mydep, tuple(candidate_list))), None) if mylist is not None: return mylist[:] @@ -600,5 +601,5 @@ def match_from_list(mydep, candidate_list): else: raise KeyError("Unknown operator: %s" % mydep) - _match_from_list_cache[(mydep, tuple(candidate_list))] = mylist + _match_from_list_cache[hash((mydep, tuple(candidate_list)))] = mylist return mylist -- 2.26.2