From e9a172b0ef5d5ebfa036e24dc96ace7a2b4aef6d Mon Sep 17 00:00:00 2001 From: hellofromTonya Date: Wed, 25 Jan 2023 21:42:15 +0000 Subject: [PATCH] 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: * https://www.php.net/manual/en/language.operators.increment.php * https://github.com/WordPress/gutenberg/pull/44551 Follow-up to [50929]. Props jrf, czapla, antonvlasenko, aristath, mamaduka. See #57527. Built from https://develop.svn.wordpress.org/trunk@55140 git-svn-id: http://core.svn.wordpress.org/trunk@54673 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/block-supports/duotone.php | 4 ++-- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-includes/block-supports/duotone.php b/wp-includes/block-supports/duotone.php index 0e04cb1631..76542d8e37 100644 --- a/wp-includes/block-supports/duotone.php +++ b/wp-includes/block-supports/duotone.php @@ -130,10 +130,10 @@ function wp_tinycolor_rgb_to_rgb( $rgb_color ) { */ function wp_tinycolor_hue_to_rgb( $p, $q, $t ) { if ( $t < 0 ) { - $t += 1; + ++$t; } if ( $t > 1 ) { - $t -= 1; + --$t; } if ( $t < 1 / 6 ) { return $p + ( $q - $p ) * 6 * $t; diff --git a/wp-includes/version.php b/wp-includes/version.php index a5ee139003..e1b34867e2 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.2-alpha-55139'; +$wp_version = '6.2-alpha-55140'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.