Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimizations Worker.php #1070

Merged
merged 1 commit into from
Nov 10, 2024
Merged

Optimizations Worker.php #1070

merged 1 commit into from
Nov 10, 2024

Conversation

joanhey
Copy link
Contributor

@joanhey joanhey commented Nov 9, 2024

Use Null coalescing assignment operator (PHP 7.4)

First check if $logFile !== '/dev/null' and later check if is_file(), so we use one stat less if not necessary and it's faster.

PD: perhaps it's better if the default is $logFile = '/dev/null'

EDIT: I see that you changed ??= to empty() in Commit 43f9aad
Initially I only wanted to change the if validation, and later changed to ??= that by default are always null, but you had change it for something.

Use Null coalescing assignment operator (PHP 7.4)

First check if logFile is 'dev/null' and later check if is_file(), so we use one stat less if not necessary.
@walkor walkor merged commit f7ce415 into walkor:master Nov 10, 2024
18 of 24 checks passed
@joanhey joanhey deleted the patch-1 branch November 10, 2024 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants