diff options
author | Felipe Oliveira Carvalho <felipekde@gmail.com> | 2014-06-25 22:03:58 -0300 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2014-06-30 03:57:50 -0400 |
commit | 45e7814e6aa8aacd8772056863d13770d4e30b48 (patch) | |
tree | 4a5f6f66176393da31454756af9f375cab804f6c /src/nvim/syntax.c | |
parent | be3a4b6ca81c4e9dd3faa81dc01f53468ceed3ad (diff) | |
download | rneovim-45e7814e6aa8aacd8772056863d13770d4e30b48.tar.gz rneovim-45e7814e6aa8aacd8772056863d13770d4e30b48.tar.bz2 rneovim-45e7814e6aa8aacd8772056863d13770d4e30b48.zip |
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;
Diffstat (limited to 'src/nvim/syntax.c')
-rw-r--r-- | src/nvim/syntax.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c index cb83bf650c..945172564b 100644 --- a/src/nvim/syntax.c +++ b/src/nvim/syntax.c @@ -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); |