bt_notification_iterator_create(): assert the type of comp. class
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 25 May 2017 21:57:09 +0000 (17:57 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sun, 28 May 2017 16:57:45 +0000 (12:57 -0400)
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
lib/graph/iterator.c

index bda2dfd3cfcd6f15558ac1a6631f6c710f4b9bc0..6819a2e9aead906f3765a251661e48081528d377 100644 (file)
@@ -467,14 +467,8 @@ struct bt_notification_iterator *bt_notification_iterator_create(
        assert(bt_port_is_connected(upstream_port));
 
        type = bt_component_get_class_type(upstream_comp);
-       switch (type) {
-       case BT_COMPONENT_CLASS_TYPE_SOURCE:
-       case BT_COMPONENT_CLASS_TYPE_FILTER:
-               break;
-       default:
-               goto error;
-       }
-
+       assert(type == BT_COMPONENT_CLASS_TYPE_SOURCE ||
+               type == BT_COMPONENT_CLASS_TYPE_FILTER);
        iterator = g_new0(struct bt_notification_iterator, 1);
        if (!iterator) {
                goto error;
This page took 0.025424 seconds and 4 git commands to generate.