- /* Consume one notification from each iterator. */
- for (i = 0; i < dummy->iterators->len; i++) {
- struct bt_notification_iterator *it;
- enum bt_notification_iterator_status it_ret;
-
- it = g_ptr_array_index(dummy->iterators, i);
-
- it_ret = bt_notification_iterator_next(it);
- switch (it_ret) {
- case BT_NOTIFICATION_ITERATOR_STATUS_ERROR:
- ret = BT_COMPONENT_STATUS_ERROR;
- goto end;
- case BT_NOTIFICATION_ITERATOR_STATUS_END:
- ret = BT_COMPONENT_STATUS_END;
- g_ptr_array_remove_index(dummy->iterators, i);
- i--;
- continue;
- default:
- break;
- }
-
- notif = bt_notification_iterator_get_notification(it);
- if (!notif) {
- ret = BT_COMPONENT_STATUS_ERROR;
- goto end;
- }
-
- /*
- * Dummy! I'm doing nothing with this notification,
- * NOTHING.
- */
- BT_PUT(notif);
+ if (unlikely(dummy->error)) {
+ ret = BT_COMPONENT_STATUS_ERROR;
+ goto end;
+ }
+
+ if (unlikely(!dummy->notif_iter)) {
+ ret = BT_COMPONENT_STATUS_END;
+ goto end;