[Lxml-checkins] r46262 - lxml/trunk/src/lxml

scoder at codespeak.net scoder at codespeak.net
Mon Sep 3 11:57:29 CEST 2007


Author: scoder
Date: Mon Sep  3 11:57:27 2007
New Revision: 46262

Modified:
   lxml/trunk/src/lxml/etree.pyx
Log:
use list instead of dict in _TempStore to reduce overhead

Modified: lxml/trunk/src/lxml/etree.pyx
==============================================================================
--- lxml/trunk/src/lxml/etree.pyx	(original)
+++ lxml/trunk/src/lxml/etree.pyx	Mon Sep  3 11:57:27 2007
@@ -172,16 +172,13 @@
 cdef class _TempStore:
     cdef object _storage
     def __init__(self):
-        self._storage = {}
+        self._storage = []
 
     cdef void add(self, obj):
-        python.PyDict_SetItem(self._storage, id(obj), obj)
+        python.PyList_Append(self._storage, obj)
 
     cdef void clear(self):
-        python.PyDict_Clear(self._storage)
-
-    cdef object dictcopy(self):
-        return self._storage.copy()
+        del self._storage[:]
 
 # class for temporarily storing exceptions raised in extensions
 cdef class _ExceptionContext:


More information about the lxml-checkins mailing list