[wp-trac] [WordPress Trac] #57527: Duotone: PHP code quality improvements

WordPress Trac noreply at wordpress.org
Wed Jan 25 21:54:58 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 commit  |     Focuses:  performance
----------------------------------------------+----------------------------

Comment (by hellofromTonya):

 In [changeset:"55141" 55141]:
 {{{
 #!CommitTicketReference repository="" revision="55141"
 Editor: Remove WP_DEBUG defined check in wp_tinycolor_hue_to_rgb().

 The constant `WP_DEBUG` is a default constant that is set within
 `wp_initial_constants()` when not defined. This means the constant will
 always be defined, thus making the `defined( 'WP_DEBUG' )` unnecessary.

 Removing the `defined()` provides these benefits:
 * Makes the code more readable.
 * Tiny performance optimization.

 References:
 * https://github.com/WordPress/gutenberg/pull/45979

 Follow-up to [52049].

 Props ocean90, spacedmonkey, mamaduka.
 See #57527.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/57527#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list