From: Martin Quinson Date: Fri, 28 Oct 2011 14:05:34 +0000 (+0200) Subject: cosmetics/tiny computation saving X-Git-Tag: exp_20120216~541 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/e391cd27527f8f95d53386e583ae761f20cf7e1c cosmetics/tiny computation saving --- diff --git a/src/xbt/xbt_strbuff.c b/src/xbt/xbt_strbuff.c index a474b3a258..4af89927a9 100644 --- a/src/xbt/xbt_strbuff.c +++ b/src/xbt/xbt_strbuff.c @@ -78,9 +78,8 @@ void xbt_strbuff_append(xbt_strbuff_t b, const char *toadd) needed_space = b->used + addlen + 1; if (needed_space > b->size) { - b->data = - realloc(b->data, MAX(minimal_increment + b->used, needed_space)); b->size = MAX(minimal_increment + b->used, needed_space); + b->data = realloc(b->data, b->size); } strcpy(b->data + b->used, toadd); b->used += addlen;