From 07a9cfb93ad567b16baae38c4fe2f3ea4e2f4e9b Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 19 Jul 2009 22:02:00 +0000 Subject: Use readlines() to optimize performance. Thanks to Marat Radchenko for this patch from bug #276813. svn path=/main/trunk/; revision=13834 --- pym/portage/cache/flat_hash.py | 2 +- pym/portage/cache/metadata.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'pym') 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: -- cgit v1.2.3-1-g7c22