From: Tim Düsterhus Date: Tue, 15 Nov 2022 10:05:38 +0000 (+0100) Subject: Remove obsolete handling of duplicated packages in PackageArchive::getExistingRequire... X-Git-Tag: 6.0.0_Alpha_1~719^2~3 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=fabf6d41006862b0a8ebdb35194bb29a8fc16a7b;p=GitHub%2FWoltLab%2FWCF.git Remove obsolete handling of duplicated packages in PackageArchive::getExistingRequirements() `package` is a UNIQUE KEY in the database, the deleted logic was dead code. --- diff --git a/wcfsetup/install/files/lib/system/package/PackageArchive.class.php b/wcfsetup/install/files/lib/system/package/PackageArchive.class.php index 0362a0ac9d..4e79ab3910 100644 --- a/wcfsetup/install/files/lib/system/package/PackageArchive.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageArchive.class.php @@ -724,19 +724,7 @@ class PackageArchive $statement = WCF::getDB()->prepare($sql); $statement->execute($conditions->getParameters()); while ($row = $statement->fetchArray()) { - if (!isset($existingPackages[$row['package']])) { - $existingPackages[$row['package']] = []; - } - - $existingPackages[$row['package']][$row['packageVersion']] = $row; - } - - // sort multiple packages by version number - foreach ($existingPackages as $packageName => $instances) { - \uksort($instances, [Package::class, 'compareVersion']); - - // get package with highest version number (get last package) - $existingPackages[$packageName] = \array_pop($instances); + $existingPackages[$row['package']] = $row; } }