mirror of
https://github.com/neovim/neovim.git
synced 2025-10-17 15:21:47 +00:00
strings.c: replace copy_spaces, copy_chars with equivalent memset.
This commit is contained in:
@@ -287,33 +287,6 @@ char_u *strup_save(const char_u *orig)
|
||||
return res;
|
||||
}
|
||||
|
||||
/*
|
||||
* copy a space a number of times
|
||||
*/
|
||||
void copy_spaces(char_u *ptr, size_t count)
|
||||
FUNC_ATTR_NONNULL_ALL
|
||||
{
|
||||
size_t i = count;
|
||||
char_u *p = ptr;
|
||||
|
||||
while (i--)
|
||||
*p++ = ' ';
|
||||
}
|
||||
|
||||
/*
|
||||
* Copy a character a number of times.
|
||||
* Does not work for multi-byte characters!
|
||||
*/
|
||||
void copy_chars(char_u *ptr, size_t count, char_u c)
|
||||
FUNC_ATTR_NONNULL_ALL
|
||||
{
|
||||
size_t i = count;
|
||||
char_u *p = ptr;
|
||||
|
||||
while (i--)
|
||||
*p++ = c;
|
||||
}
|
||||
|
||||
/*
|
||||
* delete spaces at the end of a string
|
||||
*/
|
||||
|
Reference in New Issue
Block a user