From bd2ab0d8a53f0d5b5443f9709644ade451716fe3 Mon Sep 17 00:00:00 2001 From: Felipe Oliveira Carvalho Date: Fri, 16 May 2014 15:46:13 -0300 Subject: Replace if (ga->ga_len) with if (!GA_EMPTY(ga)) Used Coccinelle to perform the changes ```diff @@ expression E; statement S; @@ ( - if (E.ga_len) S + if (!GA_EMPTY(&E)) S | - if (E->ga_len) S + if (!GA_EMPTY(E)) S ) ``` --- src/nvim/eval.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/eval.c') diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 6b6c3c51a4..86b8aaecba 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -17137,7 +17137,7 @@ void ex_execute(exarg_T *eap) p = get_tv_string(&rettv); len = (int)STRLEN(p); ga_grow(&ga, len + 2); - if (ga.ga_len) + if (!GA_EMPTY(&ga)) ((char_u *)(ga.ga_data))[ga.ga_len++] = ' '; STRCPY((char_u *)(ga.ga_data) + ga.ga_len, p); ga.ga_len += len; -- cgit