document: Optimize replace_spacing to pregrow output buffer
This commit is contained in:
parent
83df167ea2
commit
d59438f36c
1 changed files with 1 additions and 0 deletions
|
@ -336,6 +336,7 @@ static inline void
|
||||||
replace_spacing(hoedown_buffer *ob, const uint8_t *data, size_t size)
|
replace_spacing(hoedown_buffer *ob, const uint8_t *data, size_t size)
|
||||||
{
|
{
|
||||||
size_t i = 0, mark;
|
size_t i = 0, mark;
|
||||||
|
hoedown_buffer_grow(ob, size);
|
||||||
while (1) {
|
while (1) {
|
||||||
mark = i;
|
mark = i;
|
||||||
while (i < size && data[i] != '\n') i++;
|
while (i < size && data[i] != '\n') i++;
|
||||||
|
|
Loading…
Reference in a new issue