docs(action_list): small comments

This commit is contained in:
lisk77 2025-08-17 17:08:14 +02:00
parent e8338d011d
commit f7043cc03a
2 changed files with 5 additions and 0 deletions

View file

@ -1,5 +1,6 @@
#include "action_list.h"
// Create a new ActionList
ActionList* new_list() {
ActionList* list = calloc(1, sizeof(ActionList));
list->capacity = 10;
@ -8,6 +9,7 @@ ActionList* new_list() {
return list;
}
// Add an Action to the end of the ActionList
void add_action(ActionList* list, Action action) {
if (list->len >= list->capacity) {
list->capacity *= 2;
@ -21,6 +23,7 @@ void add_action(ActionList* list, Action action) {
list->actions[list->len++] = action;
}
// Concatenate two ActionLists. Modifies list1 in place
void append_list(ActionList* list1, ActionList* list2) {
uint64_t available_space = list1->capacity - list1->len;
if (available_space < list2->len) {