small optimization

This commit is contained in:
Denis Vlasenko 2006-11-24 22:42:44 +00:00
parent 3feb2fc535
commit 809a6e3104

View File

@ -15,11 +15,10 @@
*/
char* last_char_is(const char *s, int c)
{
char *sret;
if (s) {
sret = strrchr(s, c);
if (sret && !sret[1])
return sret;
s = strrchr(s, c);
if (s && !s[1])
return (char*)s;
}
return NULL;
}