Revision: c4dc717c8f12
Author:   Pekka Klärck
Date:     Sat Nov  5 14:46:42 2011
Log:      simplify "appending" to tuple. and added todo.
http://code.google.com/p/robotframework/source/detail?r=c4dc717c8f12

Modified:
 /src/robot/result/model.py

=======================================
--- /src/robot/result/model.py  Sat Nov  5 12:18:44 2011
+++ /src/robot/result/model.py  Sat Nov  5 14:46:42 2011
@@ -341,6 +341,8 @@
 class ItemList(object):

     def __init__(self, item_class, items=None, parent=None):
+        # TODO: This really should accept generic **common_attrs and not
+ # parent. Need to investigate why **common_attrs took so much memory.
         self._item_class = item_class
         self._parent = parent
         self._items = ()
@@ -357,7 +359,7 @@
% (self._item_class.__name__, type(item).__name__))
         if self._parent:
             item.parent = self._parent
-        self._items = tuple(list(self._items)+[item])
+        self._items += (item,)

     def extend(self, items):
         for item in items:

Reply via email to