summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-10-19 19:27:06 +0000
committerZac Medico <zmedico@gentoo.org>2007-10-19 19:27:06 +0000
commit9f5d814ee08c29735c6df002d11bc32f2feca53f (patch)
tree88529b613f266e0f7cd7fd5103d3edce89ca647a
parent60d2fa528eac86e73b5f30421c145cbaa3b5eb33 (diff)
downloadportage-9f5d814ee08c29735c6df002d11bc32f2feca53f.tar.gz
portage-9f5d814ee08c29735c6df002d11bc32f2feca53f.tar.bz2
portage-9f5d814ee08c29735c6df002d11bc32f2feca53f.zip
Use a list to buffer strings in _combine_logentries() and do
a single concatenation at the end for better efficiency. svn path=/main/trunk/; revision=8183
-rw-r--r--pym/portage/elog/__init__.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/pym/portage/elog/__init__.py b/pym/portage/elog/__init__.py
index 4049b5521..b9cc3f659 100644
--- a/pym/portage/elog/__init__.py
+++ b/pym/portage/elog/__init__.py
@@ -29,7 +29,7 @@ def _merge_logentries(a, b):
def _combine_logentries(logentries):
# generate a single string with all log messages
- rValue = ""
+ rValue = []
for phase in EBUILD_PHASES:
if not phase in logentries:
continue
@@ -37,11 +37,11 @@ def _combine_logentries(logentries):
for msgtype, msgcontent in logentries[phase]:
if previous_type != msgtype:
previous_type = msgtype
- rValue += "%s: %s\n" % (msgtype, phase)
+ rValue.append("%s: %s\n" % (msgtype, phase))
for line in msgcontent:
- rValue += line
- rValue += "\n"
- return rValue
+ rValue.append(line)
+ rValue.append("\n")
+ return "".join(rValue)
_elog_atexit_handlers = []
_preserve_logentries = {}