util/rb_tree: Replace useless ifs with asserts
authorJason Ekstrand <jason@jlekstrand.net>
Mon, 23 Sep 2019 17:24:12 +0000 (12:24 -0500)
committerJason Ekstrand <jason@jlekstrand.net>
Mon, 23 Sep 2019 22:38:30 +0000 (22:38 +0000)
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/util/rb_tree_test.c

index a5952b3b52db141e4b254056efc046ecee88954e..20a236d2eec2bcee54f6d46a953fd9b4bf4864a8 100644 (file)
@@ -84,7 +84,7 @@ validate_tree_order(struct rb_tree *tree, unsigned expected_count)
              * show up in the list in order of insertion.  We insert them
              * in the order they are in in the array.
              */
-            if (prev == NULL || prev < n);
+            assert(prev == NULL || prev < n);
         }
 
         prev = n;
@@ -105,7 +105,7 @@ validate_tree_order(struct rb_tree *tree, unsigned expected_count)
              * show up in the list in order of insertion.  We insert them
              * in the order they are in in the array.
              */
-            if (prev == NULL || prev > n);
+            assert(prev == NULL || prev > n);
         }
 
         prev = n;