LTTNG_ASSERT(subitems);
if (type == LTTNG_ACTION_TYPE_LIST) {
- unsigned int count, i;
-
- status = lttng_action_list_get_count(action, &count);
- LTTNG_ASSERT(status == LTTNG_ACTION_STATUS_OK);
-
- for (i = 0; i < count; i++) {
- struct lttng_action *inner_action = nullptr;
-
- inner_action = lttng_action_list_borrow_mutable_at_index(action, i);
+ for (auto inner_action : lttng::ctl::action_list_view(action)) {
LTTNG_ASSERT(inner_action);
+
ret = add_action_to_subitem_array(inner_action, subitems);
if (ret) {
goto end;