[wp-trac] [WordPress Trac] #57527: Duotone: PHP code quality improvements (was: Duotone: Two minor code quality fixes)
WordPress Trac
noreply at wordpress.org
Wed Jan 25 14:09:01 UTC 2023
#57527: Duotone: PHP code quality improvements
---------------------------------------+-----------------------------
Reporter: Mamaduka | Owner: hellofromTonya
Type: enhancement | Status: reviewing
Priority: normal | Milestone: 6.2
Component: Editor | Version:
Severity: normal | Resolution:
Keywords: has-patch gutenberg-merge | Focuses: performance
---------------------------------------+-----------------------------
Changes (by hellofromTonya):
* status: new => reviewing
* focuses: => performance
* owner: (none) => hellofromTonya
* keywords: has-patch => has-patch gutenberg-merge
Old description:
> Backports following changes from the Gutenberg plugin
>
> * Use in/decrementors where appropriate. They're more performant than an
> assignment with a calculation.
> * Don't check if constants set by `wp_initial_constants()` are defined.
New description:
PHP code quality improvements:
* Use in/decrementors where appropriate.
Why? They're more performant than an assignment with a calculation.
See https://github.com/WordPress/gutenberg/pull/44551.
* Don't check if constants set by `wp_initial_constants()` are defined.
This reduces the number of `defined()` calls for constants which are
always set. Why? `wp_initial_constants()` makes sure that all the default
constants are set.
See https://github.com/WordPress/gutenberg/pull/45979.
--
--
Ticket URL: <https://core.trac.wordpress.org/ticket/57527#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list