summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-07-19 22:02:00 +0000
committerZac Medico <zmedico@gentoo.org>2009-07-19 22:02:00 +0000
commit07a9cfb93ad567b16baae38c4fe2f3ea4e2f4e9b (patch)
tree4ae6498204fc3e4cc3dc52dc9f9e24c1095a3ffc
parent023d296efc7f1160366c039cc02aff04623e9867 (diff)
downloadportage-07a9cfb93ad567b16baae38c4fe2f3ea4e2f4e9b.tar.gz
portage-07a9cfb93ad567b16baae38c4fe2f3ea4e2f4e9b.tar.bz2
portage-07a9cfb93ad567b16baae38c4fe2f3ea4e2f4e9b.zip
Use readlines() to optimize performance. Thanks to Marat Radchenko
<slonopotamusorama@gmail.com> for this patch from bug #276813. svn path=/main/trunk/; revision=13834
-rw-r--r--pym/portage/cache/flat_hash.py2
-rw-r--r--pym/portage/cache/metadata.py1
2 files changed, 1 insertions, 2 deletions
diff --git a/pym/portage/cache/flat_hash.py b/pym/portage/cache/flat_hash.py
index 71ddf6023..c3c5955fb 100644
--- a/pym/portage/cache/flat_hash.py
+++ b/pym/portage/cache/flat_hash.py
@@ -29,7 +29,7 @@ class database(fs_template.FsBased):
try:
myf = codecs.open(fp, mode='r', encoding='utf_8', errors='replace')
try:
- d = self._parse_data(myf, cpv)
+ d = self._parse_data(myf.readlines(), cpv)
if '_mtime_' not in d:
# Backward compatibility with old cache
# that uses mtime mangling.
diff --git a/pym/portage/cache/metadata.py b/pym/portage/cache/metadata.py
index 724dce3cc..b51bf980f 100644
--- a/pym/portage/cache/metadata.py
+++ b/pym/portage/cache/metadata.py
@@ -34,7 +34,6 @@ class database(flat_hash.database):
def _parse_data(self, data, cpv):
_hashed_re_match = self._hashed_re.match
- data = list(data)
d = {}
for line in data: