Avoid redundant retains/releases by giving ts_stack_push move semantics

This commit is contained in:
Max Brunsfeld 2018-03-29 17:18:43 -07:00
parent 64fd5d0b4b
commit ee995c3d6b
3 changed files with 56 additions and 58 deletions

View file

@ -128,7 +128,6 @@ static StackNode *stack_node_new(StackNode *previous_node, Tree *tree, bool is_p
if (tree) {
node->depth = previous_node->depth;
if (!tree->extra) node->depth++;
ts_tree_retain(tree);
node->error_cost += tree->error_cost;
node->position = length_add(node->position, ts_tree_total_size(tree));
node->dynamic_precedence += tree->dynamic_precedence;