Use the expression assignment operator to simplify code

Suggested by phan, available since php7.4

Change-Id: I77c189ed451d08125fd6a6a008c55472cf3d046c
This commit is contained in:
Umherirrender 2023-10-14 00:53:38 +02:00
parent 9360ca94c4
commit f9f9f5dcd6

View file

@ -1204,7 +1204,7 @@ class MhchemStateMachines {
},
'output-0' => static function ( &$buffer ) {
$ret = [];
$buffer["text_"] = $buffer["text_"] ?? "";
$buffer["text_"] ??= "";
if ( strlen( $buffer["text_"] ) > 4 ) {
$a = strlen( $buffer["text_"] ) % 3;
if ( $a === 0 ) {
@ -1226,7 +1226,7 @@ class MhchemStateMachines {
},
'output-o' => static function ( &$buffer ) {
$ret = [];
$buffer["text_"] = $buffer["text_"] ?? "";
$buffer["text_"] ??= "";
if ( strlen( $buffer["text_"] ) > 4 ) {
$a = strlen( $buffer["text_"] ) - 3;
for ( $i = 0; $i < $a; $i += 3 ) {