-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[5.4] code cleanup #46156
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
base: 5.4-dev
Are you sure you want to change the base?
[5.4] code cleanup #46156
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By review this change is good.
f835855
to
c78a03f
Compare
c78a03f
to
e7877a1
Compare
@richard67 Thanks, found a couple of more places. |
What is the benefit here? Not saying the change is wrong, but is there a performance gain or so? |
@laoneo There is a performance gain as str_replace checks the whole string for spaces, while trim only checks beginning and end, which functionally is sufficient here. |
But trim checks multiple characters. Anyway, don't want to block this. But not sure if the override notification is worth the change. |
No need to hurry anyway. It might go into 5.4.1 and 6.0.1 because we are short before preparing RC 1, and between RC 1 and stable we only want to fix regressions, if some. |
<?php endif; ?> | ||
|
||
<?php if (($this->params->get('logoutdescription_show') == 1 && str_replace(' ', '', $this->params->get('logout_description', '')) != '') || $this->params->get('logout_image') != '') : ?> | ||
<?php if (($this->params->get('logoutdescription_show') == 1 && trim($this->params->get('logout_description', '')) != '') || $this->params->get('logout_image') != '') : ?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The if conditions at line 28 and line 40 are the same, so we should introduce a variable like $showLogout
to store the result of the expression at line 28 and re-use it for line 40 (instead of re-evaluate the same condition again)
Summary of Changes
Just a bit of code cleanup.
Testing Instructions
Use custom offline message on the offline page.
Actual result BEFORE applying this Pull Request
no change
Expected result AFTER applying this Pull Request
no change
Link to documentations
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed