1
0
Fork 0

Do not trigger Intervals::isSubsetOf() over and over again for platform packages

pull/8850/head
Yanick Witschi 2020-08-28 14:34:50 +02:00
parent c9201b8e40
commit a1e1cd8fa4
2 changed files with 22 additions and 0 deletions

View File

@ -245,6 +245,11 @@ class PoolBuilder
private function markPackageNameForLoading(Request $request, $name, ConstraintInterface $constraint)
{
// Skip platform requires at this stage
if (PlatformRepository::isPlatformPackage($name)) {
return;
}
// Root require (which was not unfixed) already loaded the maximum range so no
// need to check anything here
if (isset($this->maxExtendedReqs[$name])) {

View File

@ -593,4 +593,21 @@ class PlatformRepository extends ArrayRepository
$this->addPackage($lib);
}
/**
* Check if a package name is a platform package.
*
* @param $name
* @return bool
*/
public static function isPlatformPackage($name)
{
static $cache = array();
if (isset($cache[$name])) {
return $cache[$name];
}
return $cache[$name] = (bool) preg_match(PlatformRepository::PLATFORM_PACKAGE_REGEX, $name);
}
}