cli: Remove unnecessary NULL check in print_value_rec
authorSimon Marchi <simon.marchi@efficios.com>
Fri, 25 Oct 2019 21:56:36 +0000 (17:56 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 30 Oct 2019 19:14:53 +0000 (15:14 -0400)
There's no reason for `value` to legitimately be NULL here.  Replace
that with an assert so we can catch eventual mistakes.

Change-Id: I9272c4c5e862601d7c9c7b9c67a1cf332ee1770b
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/2265
Reviewed-by: Francis Deslauriers <francis.deslauriers@efficios.com>
src/cli/babeltrace2.c

index c63a16c77258990a41de6b7b023c36e56f51f17a..150b08fc12f69c079e65f5677a08fb267ec7c0bc 100644 (file)
@@ -336,9 +336,7 @@ void print_value_rec(FILE *fp, const bt_value *value, size_t indent)
        const char *str_val;
        GPtrArray *map_keys = NULL;
 
-       if (!value) {
-               goto end;
-       }
+       BT_ASSERT(value);
 
        switch (bt_value_get_type(value)) {
        case BT_VALUE_TYPE_NULL:
This page took 0.02499 seconds and 4 git commands to generate.