Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/wp-includes/class-wp-scripts.php
Original file line number Diff line number Diff line change
Expand Up @@ -1070,7 +1070,7 @@ private function filter_eligible_strategies( $handle, $eligible_strategies = nul
* @param array<string, true> $checked Optional. An array of already checked script handles, used to avoid recursive loops.
* @return string|null Highest fetch priority for the script and its dependents.
*/
private function get_highest_fetchpriority_with_dependents( string $handle, array $checked = array() ): ?string {
private function get_highest_fetchpriority_with_dependents( string $handle, array &$checked = array() ): ?string {
Copy link
Member

@westonruter westonruter Nov 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious why the lack of a reference caused a performance problem here specifically.

In WordPress 6.3 the same approach was used in the filter_eligible_strategies method:

private function filter_eligible_strategies( $handle, $eligible_strategies = null, $checked = array() ) {

// If there is a recursive dependency, return early.
if ( isset( $checked[ $handle ] ) ) {
return null;
Expand Down
Loading