Make WordPress Core

Changeset 55140


Ignore:
Timestamp:
01/25/2023 09:41:00 PM (4 years ago)
Author:
hellofromTonya
Message:

Editor: Use in/decrementors in wp_tinycolor_hue_to_rgb().

Replaces += and -= with ++$t and --$t (in/decrementors) within the wp_tinycolor_hue_to_rgb().

Why? For performance: in/decrementors are more performant than an assignment with a calculation.

References:

Follow-up to [50929].

Props jrf, czapla, antonvlasenko, aristath, mamaduka.
See #57527.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/block-supports/duotone.php

    r54873 r55140  
    131131function wp_tinycolor_hue_to_rgb( $p, $q, $t ) {
    132132        if ( $t < 0 ) {
    133                 $t += 1;
     133                ++$t;
    134134        }
    135135        if ( $t > 1 ) {
    136                 $t -= 1;
     136                --$t;
    137137        }
    138138        if ( $t < 1 / 6 ) {
Note: See TracChangeset for help on using the changeset viewer.