util: Fix util_dynarray_trim().
authorMichal Krol <michal@vmware.com>
Tue, 13 Apr 2010 07:59:49 +0000 (08:59 +0100)
committerMichal Krol <michal@vmware.com>
Tue, 13 Apr 2010 08:00:39 +0000 (09:00 +0100)
src/gallium/auxiliary/util/u_dynarray.h

index 5597581ef3e0ef76dced515c0dcd1adba4e0eceb..9d1c1713a7c47646362a003617b9af9e0bb54013 100644 (file)
@@ -87,15 +87,16 @@ util_dynarray_grow(struct util_dynarray *buf, int diff)
 static INLINE void
 util_dynarray_trim(struct util_dynarray *buf)
 {
-   if(buf->size != buf->capacity)
-   {}
-   else if(buf->size) {
-      buf->data = REALLOC(buf->data, buf->capacity, buf->size);
-      buf->capacity = buf->size;
-   } else {
-      FREE(buf->data);
-      buf->data = 0;
-      buf->capacity = 0;
+   if (buf->size != buf->capacity) {
+      if (buf->size) {
+         buf->data = REALLOC(buf->data, buf->capacity, buf->size);
+         buf->capacity = buf->size;
+      }
+      else {
+         FREE(buf->data);
+         buf->data = 0;
+         buf->capacity = 0;
+      }
    }
 }