1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-03-03 08:58:17 +03:00

small buffer resizing improvement from Morten Welinder closes #140629

* tree.c: small buffer resizing improvement from Morten Welinder
  closes #140629
Daniel
This commit is contained in:
Daniel Veillard 2004-04-20 22:20:59 +00:00
parent d087dbf392
commit bf62949f2c
2 changed files with 7 additions and 3 deletions

View File

@ -1,3 +1,8 @@
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

5
tree.c
View File

@ -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: