From b01cd459b754b38b31146107b203ff77fa7475b8 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Mon, 7 Jun 2021 16:41:11 +0200 Subject: [PATCH] Avoid checking if dir is empty if it does not even exist --- src/Composer/Downloader/ArchiveDownloader.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Composer/Downloader/ArchiveDownloader.php b/src/Composer/Downloader/ArchiveDownloader.php index dd29bb323..f3e444d59 100644 --- a/src/Composer/Downloader/ArchiveDownloader.php +++ b/src/Composer/Downloader/ArchiveDownloader.php @@ -139,8 +139,7 @@ abstract class ArchiveDownloader extends FileDownloader $renameAsOne = false; if (!file_exists($path)) { $renameAsOne = true; - } - if ($filesystem->isDirEmpty($path)) { + } elseif ($filesystem->isDirEmpty($path)) { try { if ($filesystem->removeDirectoryPhp($path)) { $renameAsOne = true;