Skip to content

Commit 12bc84e

Browse files
committed
Minor conditions simplify
1 parent 88c295b commit 12bc84e

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

ext/phar/phar.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1965,7 +1965,7 @@ int phar_detect_phar_fname_ext(const char *filename, size_t filename_len, const
19651965
*ext_str = NULL;
19661966
*ext_len = 0;
19671967

1968-
if (!filename_len || filename_len == 1) {
1968+
if (filename_len <= 1) {
19691969
return FAILURE;
19701970
}
19711971

ext/phar/phar_object.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ PHP_METHOD(Phar, mount)
482482
carry_on:
483483
if (SUCCESS != phar_mount_entry(pphar, actual, actual_len, path, path_len)) {
484484
zend_throw_exception_ex(phar_ce_PharException, 0, "Mounting of %s to %s within phar %s failed", path, actual, arch);
485-
if (path && path == entry) {
485+
if (entry && path == entry) {
486486
efree(entry);
487487
}
488488

@@ -493,7 +493,7 @@ PHP_METHOD(Phar, mount)
493493
goto finish;
494494
}
495495

496-
if (entry && path && path == entry) {
496+
if (entry && path == entry) {
497497
efree(entry);
498498
}
499499

ext/phar/util.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1247,7 +1247,7 @@ phar_entry_info *phar_get_entry_info_dir(phar_archive_data *phar, char *path, si
12471247
}
12481248

12491249
if (is_dir) {
1250-
if (!path_len || path_len == 1) {
1250+
if (path_len <= 1) {
12511251
return NULL;
12521252
}
12531253
path_len--;

sapi/fpm/status.html.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@
215215
doc_rate.disabled = false;
216216
} else {
217217
delay = parseInt(doc_rate.value);
218-
if (!delay || delay < 1) {
218+
if (delay < 1) {
219219
doc_status.innerHTML = "Not valid 'refresh' value";
220220
return;
221221
}

0 commit comments

Comments
 (0)