PhotoMosaic: break out early in case of perfect score

This commit is contained in:
Aaron van Geffen 2023-12-20 16:25:58 +01:00
parent 37cc627e20
commit 321e2587b5

View File

@ -220,6 +220,10 @@ class PhotoMosaic
{ {
$score = $this->getScoreForRow($imageSelection, $requiredImageTypes); $score = $this->getScoreForRow($imageSelection, $requiredImageTypes);
$fitnessScores[$layout] = [$score, $imageSelection]; $fitnessScores[$layout] = [$score, $imageSelection];
// Perfect score? Bail out early
if ($score === count($requiredImageTypes))
break;
} }
} }