diff options
author | Zac Medico <zmedico@gentoo.org> | 2006-10-26 08:10:35 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2006-10-26 08:10:35 +0000 |
commit | e3d5ecc57975b2a168bc436efd90bc3223f1b4e7 (patch) | |
tree | 148e8d839c13b4dd6e463e270f88e481992d771a /pym/cache/flat_list.py | |
parent | 017e1a5720d08133e8edd325bebe4145ed22add4 (diff) | |
download | portage-e3d5ecc57975b2a168bc436efd90bc3223f1b4e7.tar.gz portage-e3d5ecc57975b2a168bc436efd90bc3223f1b4e7.tar.bz2 portage-e3d5ecc57975b2a168bc436efd90bc3223f1b4e7.zip |
Reverse the relationship between __contains__ and has_key in all cache classes since python handles the "in" operator more efficiently than a has_key method call.
svn path=/main/trunk/; revision=4821
Diffstat (limited to 'pym/cache/flat_list.py')
-rw-r--r-- | pym/cache/flat_list.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pym/cache/flat_list.py b/pym/cache/flat_list.py index 65fe5a781..85efa4c02 100644 --- a/pym/cache/flat_list.py +++ b/pym/cache/flat_list.py @@ -82,7 +82,7 @@ class database(fs_template.FsBased): raise cache_errors.CacheCorruption(cpv, e) - def has_key(self, cpv): + def __contains__(self, cpv): return os.path.exists(os.path.join(self._base, cpv)) |