aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/tag.c
diff options
context:
space:
mode:
authorFelipe Oliveira Carvalho <felipekde@gmail.com>2014-06-25 22:03:58 -0300
committerJustin M. Keyes <justinkz@gmail.com>2014-06-30 03:57:50 -0400
commit45e7814e6aa8aacd8772056863d13770d4e30b48 (patch)
tree4a5f6f66176393da31454756af9f375cab804f6c /src/nvim/tag.c
parentbe3a4b6ca81c4e9dd3faa81dc01f53468ceed3ad (diff)
downloadrneovim-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/tag.c')
-rw-r--r--src/nvim/tag.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/nvim/tag.c b/src/nvim/tag.c
index c9a065391b..8c873283f0 100644
--- a/src/nvim/tag.c
+++ b/src/nvim/tag.c
@@ -1995,8 +1995,7 @@ static garray_T tag_fnames = GA_EMPTY_INIT_VALUE;
*/
static void found_tagfile_cb(char_u *fname, void *cookie)
{
- ga_grow(&tag_fnames, 1);
- ((char_u **)(tag_fnames.ga_data))[tag_fnames.ga_len++] = vim_strsave(fname);
+ GA_APPEND(char_u *, &tag_fnames, vim_strsave(fname));
}
#if defined(EXITFREE) || defined(PROTO)