Introduce GA_APPEND()

This macro is used to append an element to a growable array. It replaces this
common idiom:

   ga_grow(&ga, 1);
   ((item_type *)ga.ga_data)[ga.ga_len] = item;
   ++ga.ga_len;
This commit is contained in:
Felipe Oliveira Carvalho
2014-06-25 22:03:58 -03:00
committed by Justin M. Keyes
parent be3a4b6ca8
commit 45e7814e6a
12 changed files with 25 additions and 53 deletions

View File

@@ -1963,9 +1963,7 @@ syn_current_attr (
/* Add the index to a list, so that we can check
* later that we don't match it again (and cause an
* endless loop). */
ga_grow(&zero_width_next_ga, 1);
((int *)(zero_width_next_ga.ga_data))
[zero_width_next_ga.ga_len++] = next_match_idx;
GA_APPEND(int, &zero_width_next_ga, next_match_idx);
next_match_idx = -1;
} else
cur_si = push_next_match(cur_si);