diff options
-rw-r--r-- | pym/portage_dep.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/pym/portage_dep.py b/pym/portage_dep.py index f592d209f..c0f6467e5 100644 --- a/pym/portage_dep.py +++ b/pym/portage_dep.py @@ -478,6 +478,8 @@ def best_match_to_list(mypkg, mylist): bestm = x return bestm +_match_from_list_cache = {} + def match_from_list(mydep, candidate_list): """ Searches list for entries that matches the package. @@ -490,6 +492,11 @@ def match_from_list(mydep, candidate_list): @return: A list of package atoms that match the given package atom """ + global _match_from_list_cache + mylist = _match_from_list_cache.get((mydep, tuple(candidate_list)), None) + if mylist is not None: + return mylist[:] + from portage_util import writemsg if mydep[0] == "!": mydep = mydep[1:] @@ -585,4 +592,5 @@ def match_from_list(mydep, candidate_list): else: raise KeyError("Unknown operator: %s" % mydep) + _match_from_list_cache[(mydep, tuple(candidate_list))] = mylist return mylist |