bt_notification_iterator_create(): assert the type of comp. class
[babeltrace.git] / 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.023284 seconds and 4 git commands to generate.