Clean-up: modernize pretty_xml.cpp
[lttng-tools.git] / src / bin / lttng-sessiond / action-executor.cpp
index 31683547b1340260579fa4016c29b6130b2080f5..3fbb87f431858b6232b412cfed2ea292e6305214 100644 (file)
@@ -992,16 +992,9 @@ static int add_action_to_subitem_array(struct lttng_action *action,
        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;
This page took 0.023416 seconds and 4 git commands to generate.