From 7b990f37673ead8af4c6dd320727631d7f68bac6 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Tue, 1 Sep 2020 12:28:22 +0200 Subject: [PATCH] PoolBuilder: Move merging of constaints to be loaded into relevant section --- .../DependencyResolver/PoolBuilder.php | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/Composer/DependencyResolver/PoolBuilder.php b/src/Composer/DependencyResolver/PoolBuilder.php index 711500dc0..3c4547be7 100644 --- a/src/Composer/DependencyResolver/PoolBuilder.php +++ b/src/Composer/DependencyResolver/PoolBuilder.php @@ -265,22 +265,22 @@ class PoolBuilder $constraint = $rootRequires[$name]; } - // Maybe it was already marked before but not loaded yet. In that case - // we have to extend the constraint (we don't check if they are identical because - // MultiConstraint::create() will optimize anyway) - if (isset($this->packagesToLoad[$name])) { - // Already marked for loading and this does not expand the constraint to be loaded, nothing to do - if (Intervals::isSubsetOf($constraint, $this->packagesToLoad[$name])) { - return; - } - - // extend the constraint to be loaded - $constraint = Intervals::compactConstraint(MultiConstraint::create(array($this->packagesToLoad[$name], $constraint), false)); - } - // Not yet loaded or already marked for a reload, override the existing constraint // (either it's a new one to load, or it has already been extended above) if (!isset($this->loadedPackages[$name])) { + // Maybe it was already marked before but not loaded yet. In that case + // we have to extend the constraint (we don't check if they are identical because + // MultiConstraint::create() will optimize anyway) + if (isset($this->packagesToLoad[$name])) { + // Already marked for loading and this does not expand the constraint to be loaded, nothing to do + if (Intervals::isSubsetOf($constraint, $this->packagesToLoad[$name])) { + return; + } + + // extend the constraint to be loaded + $constraint = Intervals::compactConstraint(MultiConstraint::create(array($this->packagesToLoad[$name], $constraint), false)); + } + $this->packagesToLoad[$name] = $constraint; return; }