Revision: edc7173a52a0
Author:   Mikko Korpela <[email protected]>
Date:     Fri Jun 10 11:26:27 2011
Log: htmlutils.py: Optimize _Formatted result gathering from string concat to list. Based on rebot profiling
http://code.google.com/p/robotframework/source/detail?r=edc7173a52a0

Modified:
 /src/robot/utils/htmlutils.py

=======================================
--- /src/robot/utils/htmlutils.py       Thu May 19 06:40:59 2011
+++ /src/robot/utils/htmlutils.py       Fri Jun 10 11:26:27 2011
@@ -98,16 +98,16 @@

     def __init__(self, replace_whitespace):
         self._newline = '<br />\n' if replace_whitespace else '\n'
-        self._result = ""
+        self._result = []
         self._joiner = ""

     def add(self, line, join_after=True):
-        self._result += self._joiner
+        self._result += [self._joiner]
         self._joiner = self._newline if join_after else ""
-        self._result += line
+        self._result += [line]

     def result(self):
-        return self._result
+        return ''.join(self._result)


 def _format_line(line, formatting=False, replace_whitespace=True):

Reply via email to