From: Philippe Proulx Date: Thu, 25 May 2017 21:57:09 +0000 (-0400) Subject: bt_notification_iterator_create(): assert the type of comp. class X-Git-Tag: v2.0.0-pre1~169 X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=ef2f7566ae812fd52ab383be69b59fa16f6d75da bt_notification_iterator_create(): assert the type of comp. class Signed-off-by: Philippe Proulx Signed-off-by: Jérémie Galarneau --- diff --git a/lib/graph/iterator.c b/lib/graph/iterator.c index bda2dfd3..6819a2e9 100644 --- a/lib/graph/iterator.c +++ b/lib/graph/iterator.c @@ -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;