[Lxml-checkins] r51740 - in lxml/trunk: . src/lxml
scoder at codespeak.net
scoder at codespeak.net
Thu Feb 21 17:19:41 CET 2008
Author: scoder
Date: Thu Feb 21 17:19:41 2008
New Revision: 51740
Modified:
lxml/trunk/ (props changed)
lxml/trunk/src/lxml/proxy.pxi
Log:
r3550 at delle: sbehnel | 2008-02-19 20:23:54 +0100
cleanup
Modified: lxml/trunk/src/lxml/proxy.pxi
==============================================================================
--- lxml/trunk/src/lxml/proxy.pxi (original)
+++ lxml/trunk/src/lxml/proxy.pxi Thu Feb 21 17:19:41 2008
@@ -281,20 +281,22 @@
if c_cache_size == 0:
c_cache_size = 20
else:
- c_cache_size = c_cache_size * 2
+ c_cache_size *= 2
c_ns_new_cache = <xmlNs**> python.PyMem_Realloc(
c_ns_new_cache, c_cache_size * sizeof(xmlNs*))
if c_ns_new_cache is NULL:
python.PyMem_Free(c_ns_old_cache)
python.PyErr_NoMemory()
+ return -1
c_ns_old_cache = <xmlNs**> python.PyMem_Realloc(
c_ns_old_cache, c_cache_size * sizeof(xmlNs*))
if c_ns_old_cache is NULL:
python.PyMem_Free(c_ns_new_cache)
python.PyErr_NoMemory()
+ return -1
c_ns_new_cache[c_cache_last] = c_new_ns
c_ns_old_cache[c_cache_last] = c_node.ns
- c_cache_last = c_cache_last + 1
+ c_cache_last += 1
c_node.ns = c_new_ns
if c_node is c_element:
# after the element, continue with its attributes
More information about the lxml-checkins
mailing list