2001-05-04 Earnie Boyd <earnie@users.sourceforge.net>

* libc/string/strrchr.c: Use strchr for the speed improvements.
This commit is contained in:
Jeff Johnston 2001-05-04 17:23:18 +00:00
parent 69b218bf24
commit 8b3bcfbab9
2 changed files with 10 additions and 8 deletions

View File

@ -1,3 +1,7 @@
2001-05-04 Earnie Boyd <earnie@users.sourceforge.net>
* libc/string/strrchr.c: Use strchr for the speed improvements.
2001-05-01 Jeff Johnston <jjohnstn@redhat.com> 2001-05-01 Jeff Johnston <jjohnstn@redhat.com>
* libc/stdio/findfp (__sinit)[HAVE_FCNTL]: For platforms that have * libc/stdio/findfp (__sinit)[HAVE_FCNTL]: For platforms that have

View File

@ -41,20 +41,18 @@ _DEFUN (strrchr, (s, i),
int i) int i)
{ {
_CONST char *last = NULL; _CONST char *last = NULL;
char c = i;
while (*s) if (i)
{ {
if (*s == c) while (s=strchr(s, i))
{ {
last = s; last = s;
}
s++; s++;
} }
}
if (*s == c) else
{ {
last = s; last = strchr(s, i);
} }
return (char *) last; return (char *) last;