3 ms·
Firstly, that needs a rewrite in some non-sucky curly brace with pointers: Edit_Array buffer_batch_array_from_linked_list(Arena *arena, Batch_Edit *batch, i3
by kazinator 4y ago
Firstly, that needs a rewrite in some non-sucky curly brace with pointers:
Edit_Array buffer_batch_array_from_linked_list(Arena *arena, Batch_Edit *batch, i32 count)
{
Edit_Array result(arena, count); // Edit_Array has this thingy called a constructor
foreach (node in batch) // Batch_Edit * is somewhere/somehow declared iterable
{
if (result.full()) // Edit_Array has internal fill index, checked against count
break;
result.add(batch->edit); // Edit_Array has method to add and increment fill index.
}
return result; // not a function, drop the parens
}
The Edit_Array class in the original is of no help whatsoever. Like this coder or language aren't even up to abstract data types with Modula-2.