Skip to content

Commit 8881c3c

Browse files
teresynikic
authored andcommitted
Remove redundant continue in for loops
1 parent ef8fbd6 commit 8881c3c

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

ext/standard/php_crypt_r.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,7 @@ char * php_md5_crypt_r(const char *pw, const char *salt, char *out) {
154154
}
155155

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

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

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

341338
/* get the length of the true salt */
342339
sl = ep - sp;

main/snprintf.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,7 @@ PHPAPI char *php_gcvt(double value, int ndigit, char dec_point, char exponent, c
191191
*dst = '\0';
192192
} else {
193193
/* XXX - optimize */
194-
for (sign = decpt, i = 0; (sign /= 10) != 0; i++)
195-
continue;
194+
for (sign = decpt, i = 0; (sign /= 10) != 0; i++);
196195
dst[i + 1] = '\0';
197196
while (decpt != 0) {
198197
dst[i--] = '0' + decpt % 10;

0 commit comments

Comments
 (0)