From: Zac Medico Date: Fri, 19 Oct 2007 19:27:06 +0000 (-0000) Subject: Use a list to buffer strings in _combine_logentries() and do X-Git-Tag: v2.2_pre1~588 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=9f5d814ee08c29735c6df002d11bc32f2feca53f;p=portage.git 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 --- 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 = {}