Skip to content

Commit

Permalink
Remove redundant continue in for loops
Browse files Browse the repository at this point in the history
  • Loading branch information
teresy authored and nikic committed Nov 20, 2018
1 parent ef8fbd6 commit 8881c3c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
7 changes: 2 additions & 5 deletions ext/standard/php_crypt_r.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,7 @@ char * php_md5_crypt_r(const char *pw, const char *salt, char *out) {
}

/* It stops at the first '$', max 8 chars */
for (ep = sp; *ep != '\0' && *ep != '$' && ep < (sp + 8); ep++) {
continue;
}
for (ep = sp; *ep != '\0' && *ep != '$' && ep < (sp + 8); ep++);

/* get the length of the true salt */
sl = (DWORD)(ep - sp);
Expand Down Expand Up @@ -335,8 +333,7 @@ char * php_md5_crypt_r(const char *pw, const char *salt, char *out)
sp += MD5_MAGIC_LEN;

/* It stops at the first '$', max 8 chars */
for (ep = sp; *ep != '\0' && *ep != '$' && ep < (sp + 8); ep++)
continue;
for (ep = sp; *ep != '\0' && *ep != '$' && ep < (sp + 8); ep++);

/* get the length of the true salt */
sl = ep - sp;
Expand Down
3 changes: 1 addition & 2 deletions main/snprintf.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,7 @@ PHPAPI char *php_gcvt(double value, int ndigit, char dec_point, char exponent, c
*dst = '\0';
} else {
/* XXX - optimize */
for (sign = decpt, i = 0; (sign /= 10) != 0; i++)
continue;
for (sign = decpt, i = 0; (sign /= 10) != 0; i++);
dst[i + 1] = '\0';
while (decpt != 0) {
dst[i--] = '0' + decpt % 10;
Expand Down

0 comments on commit 8881c3c

Please sign in to comment.