mirror of
https://github.com/neovim/neovim.git
synced 2025-10-17 07:16:09 +00:00
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>`
This commit is contained in:

committed by
Thiago de Arruda

parent
659cd0e99a
commit
b4efff6523
@@ -185,7 +185,7 @@ void ga_append(garray_T *gap, char c)
|
||||
void append_ga_line(garray_T *gap)
|
||||
{
|
||||
// Remove trailing CR.
|
||||
if ((gap->ga_len > 0)
|
||||
if (!GA_EMPTY(gap)
|
||||
&& !curbuf->b_p_bin
|
||||
&& (((char_u *)gap->ga_data)[gap->ga_len - 1] == CAR)) {
|
||||
gap->ga_len--;
|
||||
|
Reference in New Issue
Block a user