refactor: Replace vim_strrchr() with strrchar() (#8718)

ref #1474
This commit is contained in:
ZviRackover
2018-08-11 17:14:10 +03:00
committed by Justin M. Keyes
parent 6aefae8c4e
commit 22311457ab
7 changed files with 28 additions and 36 deletions

View File

@@ -455,25 +455,6 @@ char_u *vim_strchr(const char_u *const string, const int c)
}
}
/*
* Search for last occurrence of "c" in "string".
* Return NULL if not found.
* Does not handle multi-byte char for "c"!
*/
char_u *vim_strrchr(const char_u *string, int c)
FUNC_ATTR_NONNULL_ALL FUNC_ATTR_PURE
{
const char_u *retval = NULL;
const char_u *p = string;
while (*p) {
if (*p == c)
retval = p;
MB_PTR_ADV(p);
}
return (char_u *) retval;
}
/*
* Sort an array of strings.
*/