Remove unused function
This commit is contained in:
parent
b0b8279c14
commit
f00d2ade46
2 changed files with 0 additions and 24 deletions
|
|
@ -68,29 +68,6 @@ void ts_tree_array_delete(TreePool *pool, TreeArray *self) {
|
|||
array_delete(self);
|
||||
}
|
||||
|
||||
TreeArray ts_tree_array_remove_last_n(TreeArray *self, uint32_t remove_count) {
|
||||
TreeArray result = array_new();
|
||||
if (self->size == 0 || remove_count == 0) return result;
|
||||
|
||||
uint32_t count = 0;
|
||||
uint32_t split_index = self->size - 1;
|
||||
for (; split_index + 1 > 0; split_index--) {
|
||||
Tree *tree = self->contents[split_index];
|
||||
if (!tree->extra) {
|
||||
count++;
|
||||
if (count == remove_count) break;
|
||||
}
|
||||
}
|
||||
|
||||
array_reserve(&result, self->size - split_index);
|
||||
for (uint32_t i = split_index; i < self->size; i++) {
|
||||
array_push(&result, self->contents[i]);
|
||||
}
|
||||
|
||||
self->size = split_index;
|
||||
return result;
|
||||
}
|
||||
|
||||
TreeArray ts_tree_array_remove_trailing_extras(TreeArray *self) {
|
||||
TreeArray result = array_new();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue