Commit bf62949f authored by Daniel Veillard's avatar Daniel Veillard

small buffer resizing improvement from Morten Welinder closes #140629

* tree.c: small buffer resizing improvement from Morten Welinder
  closes #140629
Daniel
parent d087dbf3
Wed Apr 21 00:19:29 CEST 2004 Daniel Veillard <daniel@veillard.com>
* tree.c: small buffer resizing improvement from Morten Welinder
closes #140629
Tue Apr 20 23:40:14 CEST 2004 Daniel Veillard <daniel@veillard.com>
* xpath.c: last version of the fix for MSC version 1200
......
......@@ -6700,9 +6700,6 @@ xmlBufferResize(xmlBufferPtr buf, unsigned int size)
if (buf->alloc == XML_BUFFER_ALLOC_IMMUTABLE) return(0);
/*take care of empty case*/
newSize = (buf->size ? buf->size*2 : size);
/* Don't resize if we don't have to */
if (size < buf->size)
return 1;
......@@ -6710,6 +6707,8 @@ xmlBufferResize(xmlBufferPtr buf, unsigned int size)
/* figure out new size */
switch (buf->alloc){
case XML_BUFFER_ALLOC_DOUBLEIT:
/*take care of empty case*/
newSize = (buf->size ? buf->size*2 : size + 10);
while (size > newSize) newSize *= 2;
break;
case XML_BUFFER_ALLOC_EXACT:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment