document: Optimize replace_spacing to pregrow output buffer

This commit is contained in:
Xavier Mendez 2014-08-14 23:36:51 +02:00
parent 83df167ea2
commit d59438f36c

View file

@ -336,6 +336,7 @@ static inline void
replace_spacing(hoedown_buffer *ob, const uint8_t *data, size_t size)
{
size_t i = 0, mark;
hoedown_buffer_grow(ob, size);
while (1) {
mark = i;
while (i < size && data[i] != '\n') i++;