Introducing List and changes in base
This commit is contained in:
@@ -151,7 +151,7 @@ struct String_Builder{
|
||||
}
|
||||
memory_zero(block, sizeof(String_Builder_Block)+1); // Also clear first byte of character data
|
||||
block->cap = size;
|
||||
SLLQueuePush(first, last, block);
|
||||
SLL_QUEUE_ADD(first, last, block);
|
||||
}
|
||||
|
||||
void init(S64 size = 4096){
|
||||
@@ -219,7 +219,7 @@ string_flatten(Allocator *a, String_Builder *b, String_Builder_Flag flags = Stri
|
||||
// @Note(Krzosa): Compute size to allocate
|
||||
S64 size = 1;
|
||||
if(is_flag_set(flags, String_Builder_Flag_AddSize)) size += sizeof(SizeU);
|
||||
For_List(b->first){
|
||||
For_Linked_List(b->first){
|
||||
size += it->len;
|
||||
}
|
||||
|
||||
@@ -231,7 +231,7 @@ string_flatten(Allocator *a, String_Builder *b, String_Builder_Flag flags = Stri
|
||||
}
|
||||
|
||||
// @Note(Krzosa): Copy the content of each block into the string
|
||||
For_List(b->first){
|
||||
For_Linked_List(b->first){
|
||||
memory_copy(result.str + result.len, it->data, it->len);
|
||||
result.len += it->len;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user