From 9f5d814ee08c29735c6df002d11bc32f2feca53f Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 19 Oct 2007 19:27:06 +0000 Subject: [PATCH] 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 --- pym/portage/elog/__init__.py | 10 +++++----- 1 file 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 = {} -- 2.26.2