projects
/
oweals
/
musl.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 91eb7404fd2bc127c7db8b65038356b1c2ec7873..808bd8370ddeca3a2cfc124601cbd6012be89f80 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;
}