[wp-trac] [WordPress Trac] #58724: Remove deprecated parameter test in convert_chars()
WordPress Trac
noreply at wordpress.org
Thu Jul 6 06:55:30 UTC 2023
#58724: Remove deprecated parameter test in convert_chars()
--------------------------+-----------------------------
Reporter: Cybr | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version:
Severity: normal | Keywords:
Focuses: performance |
--------------------------+-----------------------------
Similar: #58723.
In `convert_chars()`, the last parameter is unused and is checked if it's
not empty. If is is, only a deprecation warning is shown for a WordPress
version of the distant past.
I suggest removing the parameter altogether.
If we _must_ keep the deprecation warning, at least use `if ( $deprecated
)` instead of `if ( ! empty( $deprecated ) )` for the former is about 2.7x
faster while achieving the same.
Here's the test proving `! empty()` is slower than a plain boolean check:
https://3v4l.org/YvKIn.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/58724>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list