From b4efff652388260b548324f870201a5804e097f0 Mon Sep 17 00:00:00 2001 From: Felipe Oliveira Carvalho Date: Wed, 7 May 2014 21:32:11 -0300 Subject: Replace ga->ga_len > 0 checks with !GA_EMPTY(ga) Used Coccinelle to perform the changes ```diff @@ expression E; @@ <... ( - E.ga_len > 0 + !GA_EMPTY(&E) | - E->ga_len > 0 + !GA_EMPTY(E) ) ...> ``` `spatch --in-place --sp-file ga_empty.cocci ` --- src/nvim/regexp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/regexp.c') diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c index b724439401..8241770bd3 100644 --- a/src/nvim/regexp.c +++ b/src/nvim/regexp.c @@ -4697,7 +4697,7 @@ regmatch ( * If there is something on the regstack execute the code for the state. * If the state is popped then loop and use the older state. */ - while (regstack.ga_len > 0 && status != RA_FAIL) { + while (!GA_EMPTY(®stack) && status != RA_FAIL) { rp = (regitem_T *)((char *)regstack.ga_data + regstack.ga_len) - 1; switch (rp->rs_state) { case RS_NOPEN: -- cgit