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
This commit is contained in:
parent
adbfbb6bfb
commit
e9a172b0ef
|
@ -130,10 +130,10 @@ function wp_tinycolor_rgb_to_rgb( $rgb_color ) {
|
||||||
*/
|
*/
|
||||||
function wp_tinycolor_hue_to_rgb( $p, $q, $t ) {
|
function wp_tinycolor_hue_to_rgb( $p, $q, $t ) {
|
||||||
if ( $t < 0 ) {
|
if ( $t < 0 ) {
|
||||||
$t += 1;
|
++$t;
|
||||||
}
|
}
|
||||||
if ( $t > 1 ) {
|
if ( $t > 1 ) {
|
||||||
$t -= 1;
|
--$t;
|
||||||
}
|
}
|
||||||
if ( $t < 1 / 6 ) {
|
if ( $t < 1 / 6 ) {
|
||||||
return $p + ( $q - $p ) * 6 * $t;
|
return $p + ( $q - $p ) * 6 * $t;
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @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.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue