Remove a useless memory allocation in column annotation. The compiler is now just 0.5% slower than before.

[COMPILER]
* OPT: Remove a useless memory allocation in column annotation. The compiler is now just 0.5% slower than before.
This commit is contained in:
gambas 2019-05-08 06:27:14 +02:00
parent 9f2da35cbe
commit 7ea4fb4ca5
2 changed files with 2 additions and 5 deletions

View File

@ -888,7 +888,7 @@ static void trans_expression(bool check_statement)
JOB->step = JOB_STEP_CODE;
FREE(&tree);
FREE(&_tree_pos);
_tree_pos = NULL;
_tree_length = 0;
if (check_statement)

View File

@ -832,10 +832,7 @@ void TRANS_tree(bool check_statement, TRANS_TREE **result, int *count, int **res
ALLOC(result, sizeof(PATTERN) * _tree_length);
memcpy(*result, _tree, sizeof(PATTERN) * _tree_length);
if (result_pos)
{
ALLOC(result_pos, sizeof(int) * _tree_length);
memcpy(*result_pos, _tree_pos, sizeof(int) * _tree_length);
}
*result_pos = _tree_pos;
*count = _tree_length - 1;
}
}