changeset 29693:328f17988caf

Rearrange code of grow_array to make it easier to extend.
author reimar
date Wed, 30 Sep 2009 07:35:33 +0000
parents 235868858ee7
children 58b03e2d2ac2
files libmpdemux/demux_mkv.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_mkv.c	Wed Sep 30 07:33:05 2009 +0000
+++ b/libmpdemux/demux_mkv.c	Wed Sep 30 07:35:33 2009 +0000
@@ -211,8 +211,9 @@
 static void grow_array(void *arrayp, int nelem, size_t elsize) {
   void **array = arrayp;
   void *oldp = *array;
-  if (!(nelem & 31))
-    *array = realloc(*array, (nelem + 32) * elsize);
+  if (nelem & 31)
+    return;
+  *array = realloc(*array, (nelem + 32) * elsize);
   if (!*array)
     free(oldp);
 }