From a9eee8cef3cf38be62b519ddf9163083fd328f97 Mon Sep 17 00:00:00 2001 From: Matthew Reishus Date: Mon, 7 Oct 2024 16:02:06 -0500 Subject: [PATCH] Revert "find_psr4_file: Quick exit if psr4_map is not populated (#39646)" This reverts commit c647351719be15f176431cf989428f2d19841206. --- projects/packages/autoloader/changelog/update-find_psr4_file | 5 ----- projects/packages/autoloader/src/class-version-loader.php | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) delete mode 100644 projects/packages/autoloader/changelog/update-find_psr4_file diff --git a/projects/packages/autoloader/changelog/update-find_psr4_file b/projects/packages/autoloader/changelog/update-find_psr4_file deleted file mode 100644 index 2cb91509495ff..0000000000000 --- a/projects/packages/autoloader/changelog/update-find_psr4_file +++ /dev/null @@ -1,5 +0,0 @@ -Significance: patch -Type: changed -Comment: Minor internal optimization to PSR-4 autoloader; no user-facing impact or action required. - - diff --git a/projects/packages/autoloader/src/class-version-loader.php b/projects/packages/autoloader/src/class-version-loader.php index cc7dcd6d4d854..c3f3fc3dce896 100644 --- a/projects/packages/autoloader/src/class-version-loader.php +++ b/projects/packages/autoloader/src/class-version-loader.php @@ -135,7 +135,7 @@ private function select_newest_file( $classmap_data, $psr4_data ) { * @return array|null $data The version and path path to the file if found, null otherwise. */ private function find_psr4_file( $class_name ) { - if ( empty( $this->psr4_map ) ) { + if ( ! isset( $this->psr4_map ) ) { return null; }