0
0
mirror of https://github.com/vim/vim.git synced 2025-09-28 04:24:06 -04:00

patch 7.4.783

Problem:    copy_chars() and copy_spaces() are inefficient.
Solution:   Use memset() instead. (Dominique Pelle)
This commit is contained in:
Bram Moolenaar
2015-07-17 13:22:51 +02:00
parent 5d1bc78a2b
commit 2536d4f396
6 changed files with 20 additions and 54 deletions

View File

@@ -1599,40 +1599,6 @@ strup_save(orig)
}
#endif
/*
* copy a space a number of times
*/
void
copy_spaces(ptr, count)
char_u *ptr;
size_t count;
{
size_t i = count;
char_u *p = ptr;
while (i--)
*p++ = ' ';
}
#if defined(FEAT_VISUALEXTRA) || defined(PROTO)
/*
* Copy a character a number of times.
* Does not work for multi-byte characters!
*/
void
copy_chars(ptr, count, c)
char_u *ptr;
size_t count;
int c;
{
size_t i = count;
char_u *p = ptr;
while (i--)
*p++ = c;
}
#endif
/*
* delete spaces at the end of a string
*/