]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
generic/array: shot myself to the foot
authorMarek Vavruša <marek.vavrusa@nic.cz>
Thu, 4 Jun 2015 21:28:48 +0000 (23:28 +0200)
committerMarek Vavruša <marek.vavrusa@nic.cz>
Thu, 4 Jun 2015 22:04:04 +0000 (00:04 +0200)
lib/generic/array.h
tests/test_array.c

index a9316482b5d146c90f868e975f9017ec8995e1c2..c76228be7f0fd4b9df69b4b6e0c336edd79fefa0 100644 (file)
@@ -133,10 +133,9 @@ static inline void array_std_free(void *baton, void *p)
 
 /**
  * Pop value from the end of the array.
- * @return 0 on success, <0 on failure
  */
 #define array_pop(array) \
-       array_del((array), (array).len - 1)
+       (array).len -= 1
 
 /**
  * Remove value at given index.
index 4bfb792545da353589205c398598608c09939f1a..52f35e7cb277e80a42f73b9afabcd80e61c014f8 100644 (file)
@@ -45,8 +45,7 @@ static void test_array(void **state)
        /* Delete elements. */
        array_del(arr, 0);
        for (size_t i = arr.len; --i;) {
-               ret = array_pop(arr);
-               assert_true(ret == 0);
+               array_pop(arr);
        }
 
        /* Overfill. */