From: Simon Marchi Date: Tue, 5 Mar 2024 21:05:05 +0000 (-0500) Subject: sink.utils.dummy: remove unnecessary check in dummy_consume() X-Git-Url: https://git.efficios.com/?a=commitdiff_plain;ds=sidebyside;h=be0f44d1b1e20aef3b8786e3f97e45ce3d037f61;p=babeltrace.git sink.utils.dummy: remove unnecessary check in dummy_consume() Given the lifecycle of a component, I'm pretty sure this condition can never be true. For dummy_consume() to be called, dummy_graph_is_configured() must execute successfully. If dummy_graph_is_configured() executes successfully, `dummy->msg_iter` is necessarily set. Change-Id: I5c11c6b76c8cb267f0185c1a35bc2f5e70826509 Signed-off-by: Simon Marchi Reviewed-on: https://review.lttng.org/c/babeltrace/+/12009 Reviewed-by: Philippe Proulx Tested-by: jenkins --- diff --git a/src/plugins/utils/dummy/dummy.c b/src/plugins/utils/dummy/dummy.c index 330a6863..e237bcbd 100644 --- a/src/plugins/utils/dummy/dummy.c +++ b/src/plugins/utils/dummy/dummy.c @@ -127,7 +127,6 @@ end: bt_component_class_sink_consume_method_status dummy_consume( bt_self_component_sink *component) { - bt_component_class_sink_consume_method_status status; bt_message_array_const msgs; uint64_t count; struct dummy *dummy; @@ -138,11 +137,7 @@ bt_component_class_sink_consume_method_status dummy_consume( dummy = bt_self_component_get_data(self_comp); BT_ASSERT_DBG(dummy); - - if (G_UNLIKELY(!dummy->msg_iter)) { - status = BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_END; - goto end; - } + BT_ASSERT_DBG(dummy->msg_iter); /* Consume one message */ next_status = bt_message_iterator_next( @@ -164,8 +159,5 @@ bt_component_class_sink_consume_method_status dummy_consume( break; } - status = (int) next_status; - -end: - return status; + return (int) next_status; }