forked from Public/pics
PhotoMosaic: break out early in case of perfect score
This commit is contained in:
parent
37cc627e20
commit
321e2587b5
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user