summaryrefslogtreecommitdiffstats
path: root/pym/cache/sqlite.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-10-26 08:10:35 +0000
committerZac Medico <zmedico@gentoo.org>2006-10-26 08:10:35 +0000
commite3d5ecc57975b2a168bc436efd90bc3223f1b4e7 (patch)
tree148e8d839c13b4dd6e463e270f88e481992d771a /pym/cache/sqlite.py
parent017e1a5720d08133e8edd325bebe4145ed22add4 (diff)
downloadportage-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/sqlite.py')
-rw-r--r--pym/cache/sqlite.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/pym/cache/sqlite.py b/pym/cache/sqlite.py
index 571eff39b..6b1a3d323 100644
--- a/pym/cache/sqlite.py
+++ b/pym/cache/sqlite.py
@@ -200,7 +200,7 @@ class database(fs_template.FsBased):
self._db_table["packages"]["package_key"],
self._db_escape_string(cpv)))
- def has_key(self, cpv):
+ def __contains__(self, cpv):
cursor = self._db_cursor
cursor.execute(" ".join(
["SELECT %s FROM %s" %