Remove logic for recovering from OOM

This commit is contained in:
Max Brunsfeld 2016-11-04 09:18:38 -07:00
parent e53beb66c9
commit 4106ecda43
14 changed files with 162 additions and 501 deletions

View file

@ -6,21 +6,19 @@
typedef Array(TSRange) RangeArray;
static bool range_array_add(RangeArray *results, TSPoint start, TSPoint end) {
static void range_array_add(RangeArray *results, TSPoint start, TSPoint end) {
if (results->size > 0) {
TSRange *last_range = array_back(results);
if (ts_point_lte(start, last_range->end)) {
last_range->end = end;
return true;
return;
}
}
if (ts_point_lt(start, end)) {
TSRange range = { start, end };
return array_push(results, range);
array_push(results, range);
}
return true;
}
static bool tree_path_descend(TreePath *path, TSPoint position) {
@ -109,7 +107,7 @@ static bool tree_must_eq(TSTree *old_tree, TSTree *new_tree) {
);
}
static bool tree_path_get_changes(TreePath *old_path, TreePath *new_path,
static void tree_path_get_changes(TreePath *old_path, TreePath *new_path,
TSRange **ranges, size_t *range_count) {
TSPoint position = { 0, 0 };
RangeArray results = array_new();
@ -195,7 +193,6 @@ static bool tree_path_get_changes(TreePath *old_path, TreePath *new_path,
*ranges = results.contents;
*range_count = results.size;
return true;
}
#endif // RUNTIME_TREE_PATH_H_