From: Luca Barbieri Date: Tue, 13 Apr 2010 06:24:48 +0000 (+0200) Subject: gallium/auxiliary: make util_dynarray_trim do nothing if size == capacity X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bf7e0e839f3221e198e2c50810afd967d91a5a77;p=mesa.git gallium/auxiliary: make util_dynarray_trim do nothing if size == capacity --- diff --git a/src/gallium/auxiliary/util/u_dynarray.h b/src/gallium/auxiliary/util/u_dynarray.h index d16d8bf4f3c..5597581ef3e 100644 --- a/src/gallium/auxiliary/util/u_dynarray.h +++ b/src/gallium/auxiliary/util/u_dynarray.h @@ -87,7 +87,9 @@ util_dynarray_grow(struct util_dynarray *buf, int diff) static INLINE void util_dynarray_trim(struct util_dynarray *buf) { - if(buf->size) { + if(buf->size != buf->capacity) + {} + else if(buf->size) { buf->data = REALLOC(buf->data, buf->capacity, buf->size); buf->capacity = buf->size; } else {