From e3d5ecc57975b2a168bc436efd90bc3223f1b4e7 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 26 Oct 2006 08:10:35 +0000 Subject: 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 --- pym/cache/flat_hash.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pym/cache/flat_hash.py') diff --git a/pym/cache/flat_hash.py b/pym/cache/flat_hash.py index d4c5930c7..a8adb2205 100644 --- a/pym/cache/flat_hash.py +++ b/pym/cache/flat_hash.py @@ -98,7 +98,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.location, cpv)) -- cgit v1.2.3-1-g7c22