garray: refactor and optimize ga_concat

I've checked all uses of ga_concat in the codebase:

- ex_cmds2.c
- ex_getln.c
- eval.c
- message.c
- regexp-nfa.c
- term.c
- spell.c

None of them concats the garray with itself. This makes it safe to use the
faster memcpy() instead of memmove(). This change was also documented.
This commit is contained in:
Nicolas Hillegeer
2014-04-28 21:07:03 +02:00
committed by Thiago de Arruda
parent 767f0fae0b
commit eea98c4d3b
2 changed files with 9 additions and 5 deletions

View File

@@ -24,7 +24,7 @@ char_u *ga_concat_strings_sep(const garray_T *gap, const char *sep)
FUNC_ATTR_NONNULL_RET;
char_u *ga_concat_strings(const garray_T *gap) FUNC_ATTR_NONNULL_RET;
void ga_remove_duplicate_strings(garray_T *gap);
void ga_concat(garray_T *gap, char_u *s);
void ga_concat(garray_T *gap, const char_u *restrict s);
void ga_append(garray_T *gap, char c);
void append_ga_line(garray_T *gap);