Introduce GA_APPEND()

This macro is used to append an element to a growable array. It replaces this
common idiom:

   ga_grow(&ga, 1);
   ((item_type *)ga.ga_data)[ga.ga_len] = item;
   ++ga.ga_len;
This commit is contained in:
Felipe Oliveira Carvalho
2014-06-25 22:03:58 -03:00
committed by Justin M. Keyes
parent be3a4b6ca8
commit 45e7814e6a
12 changed files with 25 additions and 53 deletions

View File

@@ -9138,8 +9138,7 @@ someerror:
if (c < 0) {
goto someerror;
}
ga_grow(&ga, 1);
((char_u *)ga.ga_data)[ga.ga_len++] = c;
GA_APPEND(char_u, &ga, c);
if (c == NUL)
break;
}