diff options
author | Felipe Oliveira Carvalho <felipekde@gmail.com> | 2014-12-11 13:05:37 -0300 |
---|---|---|
committer | Felipe Oliveira Carvalho <felipekde@gmail.com> | 2014-12-11 20:22:37 -0300 |
commit | e11a5699be83684294c8c235a5f5030e12666206 (patch) | |
tree | fa092586a053b42d83052f51b9baac8f36b29817 /src/nvim/eval.c | |
parent | 8ee5659d83383d857039f8fc58d7ebc21df27905 (diff) | |
download | rneovim-e11a5699be83684294c8c235a5f5030e12666206.tar.gz rneovim-e11a5699be83684294c8c235a5f5030e12666206.tar.bz2 rneovim-e11a5699be83684294c8c235a5f5030e12666206.zip |
Use GA_DEEP_CLEAR where appropriate
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r-- | src/nvim/eval.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index b4d1677520..5a2cb22946 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -5420,20 +5420,12 @@ static int list_join(garray_T *gap, list_T *l, char_u *sep, int echo_style, int { garray_T join_ga; int retval; - join_T *p; ga_init(&join_ga, (int)sizeof(join_T), l->lv_len); retval = list_join_inner(gap, l, sep, echo_style, copyID, &join_ga); - /* Dispose each item in join_ga. */ - if (join_ga.ga_data != NULL) { - p = (join_T *)join_ga.ga_data; - for (int i = 0; i < join_ga.ga_len; ++i) { - free(p->tofree); - ++p; - } - ga_clear(&join_ga); - } +# define FREE_JOIN_TOFREE(join) free((join)->tofree) + GA_DEEP_CLEAR(&join_ga, join_T, FREE_JOIN_TOFREE); return retval; } |