Skip to content

Commit 6f63e3a

Browse files
Optimize array_merge
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent f14876d commit 6f63e3a

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎src/Block_Search_Command.php‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,9 @@ private function flatten_blocks( array $blocks, $ancestor_pattern_name = '' ) {
453453
$flat_blocks[] = $block;
454454

455455
if ( ! empty( $block['innerBlocks'] ) ) {
456-
$flat_blocks = array_merge( $flat_blocks, $this->flatten_blocks( $block['innerBlocks'], $block_pattern_name ) );
456+
foreach ( $this->flatten_blocks( $block['innerBlocks'], $block_pattern_name ) as $inner_block ) {
457+
$flat_blocks[] = $inner_block;
458+
}
457459
}
458460
}
459461

0 commit comments

Comments
 (0)