Mercurial > libedl
comparison src/str.c @ 5:a6ab6d9c0dac
readme: fix typos, str: remove outdated note
our allocator is actually fairly smart now :)
| author | Paper <mrpapersonic@gmail.com> |
|---|---|
| date | Mon, 25 Dec 2023 16:26:46 -0500 |
| parents | c2408abb258a |
| children | 0c98b46eaf73 |
comparison
equal
deleted
inserted
replaced
| 4:c2408abb258a | 5:a6ab6d9c0dac |
|---|---|
| 27 | 27 |
| 28 return 1; | 28 return 1; |
| 29 } | 29 } |
| 30 | 30 |
| 31 int EDL_internal_string_append(EDL_internal_string* str, const char* data, const size_t length) { | 31 int EDL_internal_string_append(EDL_internal_string* str, const char* data, const size_t length) { |
| 32 /* this sucks, but I'm too lazy to write anything smarter. */ | |
| 33 { | 32 { |
| 34 size_t capacity = 1; | 33 size_t capacity = 1; |
| 35 while (capacity < (str->size + length + 1)) | 34 while (capacity < (str->size + length + 1)) |
| 36 capacity *= 2; | 35 capacity *= 2; |
| 37 | 36 |
