OSDN Git Service
(root)
/
android-x86
/
external-musl-libc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8ff810d
)
strcmp: Remove unnecessary check for *r
author
Michael Forney
<mforney@mforney.org>
Tue, 5 Nov 2013 05:48:08 +0000
(21:48 -0800)
committer
Rich Felker
<dalias@aerifal.cx>
Sat, 23 Nov 2013 21:17:38 +0000
(16:17 -0500)
If *l == *r && *l, then by transitivity, *r.
src/string/strcmp.c
patch
|
blob
|
history
diff --git
a/src/string/strcmp.c
b/src/string/strcmp.c
index
91eb740
..
808bd83
100644
(file)
--- a/
src/string/strcmp.c
+++ b/
src/string/strcmp.c
@@
-2,6
+2,6
@@
int strcmp(const char *l, const char *r)
{
- for (; *l==*r && *l
&& *r
; l++, r++);
+ for (; *l==*r && *l; l++, r++);
return *(unsigned char *)l - *(unsigned char *)r;
}