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* last_char_is(const char *s, int c)
{ {
char *sret;
if (s) { if (s) {
sret = strrchr(s, c); s = strrchr(s, c);
if (sret && !sret[1]) if (s && !s[1])
return sret; return (char*)s;
} }
return NULL; return NULL;
} }