summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLuca Barbieri <[email protected]>2010-04-13 08:24:48 +0200
committerLuca Barbieri <[email protected]>2010-04-13 08:26:00 +0200
commitbf7e0e839f3221e198e2c50810afd967d91a5a77 (patch)
tree46a064db0e9d7d2ebcfb44f0e2f029af33b236ec /src
parent6c31dd119878378540b6bdbb2f47bc5ab6cc516f (diff)
gallium/auxiliary: make util_dynarray_trim do nothing if size == capacity
Diffstat (limited to 'src')
-rw-r--r--src/gallium/auxiliary/util/u_dynarray.h4
1 files changed, 3 insertions, 1 deletions
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 {