1
0
Fork 0

Re-use precalculated information (#11968)

Co-authored-by: Jordi Boggiano <j.boggiano@seld.be>
pull/11972/head
Yanick Witschi 2024-05-08 14:27:20 +02:00 committed by GitHub
parent 8254811c07
commit 829e0e767f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -57,7 +57,7 @@ class DefaultPolicy implements PolicyInterface
}
// dev versions need to be compared as branches via matchSpecific's special treatment, the rest can be optimized with compiling matcher
if (strpos($a->getVersion(), 'dev-') === 0 || strpos($b->getVersion(), 'dev-') === 0) {
if (($a->isDev() && str_starts_with($a->getVersion(), 'dev-')) || ($b->isDev() && str_starts_with($b->getVersion(), 'dev-'))) {
$constraint = new Constraint($operator, $b->getVersion());
$version = new Constraint('==', $a->getVersion());