Avoid one heap allocation when instantiating a TSTreeCursor

This commit is contained in:
Max Brunsfeld 2018-05-16 16:05:08 -07:00
parent 6fc8d9871c
commit e3670be42f
8 changed files with 96 additions and 86 deletions

View file

@ -36,7 +36,7 @@ void ts_tree_edit(TSTree *self, const TSInputEdit *edit) {
TSRange *ts_tree_get_changed_ranges(const TSTree *self, const TSTree *other, uint32_t *count) {
TSRange *result;
TSTreeCursor cursor1, cursor2;
TreeCursor cursor1, cursor2;
ts_tree_cursor_init(&cursor1, self);
ts_tree_cursor_init(&cursor2, self);
*count = ts_subtree_get_changed_ranges(