diff options
author | Felipe Oliveira Carvalho <felipekde@gmail.com> | 2014-05-07 21:32:11 -0300 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-05-17 07:02:44 -0300 |
commit | b4efff652388260b548324f870201a5804e097f0 (patch) | |
tree | b7afb575a4640ef28e06b6a6519839420996a492 /src/nvim/ex_docmd.c | |
parent | 659cd0e99a0993497279ef8538956eec9f2fc374 (diff) | |
download | rneovim-b4efff652388260b548324f870201a5804e097f0.tar.gz rneovim-b4efff652388260b548324f870201a5804e097f0.tar.bz2 rneovim-b4efff652388260b548324f870201a5804e097f0.zip |
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 <C_FILE>`
Diffstat (limited to 'src/nvim/ex_docmd.c')
-rw-r--r-- | src/nvim/ex_docmd.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 268e625b48..368d5c9b0c 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -872,7 +872,7 @@ int flags; * When not inside any ":while" loop, clear remembered lines. */ if (cstack.cs_looplevel == 0) { - if (lines_ga.ga_len > 0) { + if (!GA_EMPTY(&lines_ga)) { sourcing_lnum = ((wcmd_T *)lines_ga.ga_data)[lines_ga.ga_len - 1].lnum; free_cmdlines(&lines_ga); @@ -1188,7 +1188,7 @@ static void store_loop_line(garray_T *gap, char_u *line) */ static void free_cmdlines(garray_T *gap) { - while (gap->ga_len > 0) { + while (!GA_EMPTY(gap)) { free(((wcmd_T *)(gap->ga_data))[gap->ga_len - 1].line); --gap->ga_len; } |