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/sql_template.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/sql_template.py')
-rw-r--r-- | pym/cache/sql_template.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pym/cache/sql_template.py b/pym/cache/sql_template.py index 5c8af08f8..e635616e9 100644 --- a/pym/cache/sql_template.py +++ b/pym/cache/sql_template.py @@ -196,7 +196,7 @@ class SQLDatabase(template.database): return self.con.fetchone()[0] - def has_key(self, cpv): + def __contains__(self, cpv): if not self.autocommits: try: self.commit() except self._BaseError, e: |