actions: list: Add `for_each_action_{const, mutable}()` macros
[lttng-tools.git] / src / bin / lttng-sessiond / action-executor.cpp
index 31683547b1340260579fa4016c29b6130b2080f5..a9476bd31dd4a95636a70e38d5f169c6db121c62 100644 (file)
@@ -992,16 +992,11 @@ static int add_action_to_subitem_array(struct lttng_action *action,
        LTTNG_ASSERT(subitems);
 
        if (type == LTTNG_ACTION_TYPE_LIST) {
-               unsigned int count, i;
+               struct lttng_action *inner_action = NULL;
 
-               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_each_action_mutable (inner_action, action) {
                        LTTNG_ASSERT(inner_action);
+
                        ret = add_action_to_subitem_array(inner_action, subitems);
                        if (ret) {
                                goto end;
This page took 0.022536 seconds and 4 git commands to generate.