summaryrefslogtreecommitdiff
path: root/src/iterator.c
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-05-07 10:52:06 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2015-05-07 10:52:06 -0700
commitbc5f16f146558a1faf9be6abe034755421f6ecce (patch)
tree5e82e01b37302e5f74eeaa52d76d1383ba22beb5 /src/iterator.c
parent1c242b8759413e3c1dd01a083a113b43ae4bff55 (diff)
cmark_consolidate_text_nodes: Avoid an unnecessary string allocation.
Diffstat (limited to 'src/iterator.c')
-rw-r--r--src/iterator.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/iterator.c b/src/iterator.c
index 6d77ffc..f18e3bf 100644
--- a/src/iterator.c
+++ b/src/iterator.c
@@ -138,8 +138,8 @@ void cmark_consolidate_text_nodes(cmark_node *root)
cmark_node_free(tmp);
tmp = next;
}
- cmark_strbuf_putc(&buf, 0);
- cmark_node_set_literal(cur, (char *)buf.ptr);
+ cmark_chunk_free(&cur->as.literal);
+ cur->as.literal = cmark_chunk_buf_detach(&buf);
}
}