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
1 changed files with 4 additions and 0 deletions

View File

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