remove unnecessary code

This commit is contained in:
Jörn Friedrich Dreyer 2014-04-02 17:34:48 +02:00
parent b8248f4a0a
commit bca6cc6f74

View file

@ -373,24 +373,8 @@ class Preview {
$possibleThumbnails[$x] = $thumbnail['path'];
}
if (count($possibleThumbnails) === 0) {
return false;
}
if (count($possibleThumbnails) === 1) {
return current($possibleThumbnails);
}
ksort($possibleThumbnails);
if (key(reset($possibleThumbnails)) > $maxX) {
return current(reset($possibleThumbnails));
}
if (key(end($possibleThumbnails)) < $maxX) {
return current(end($possibleThumbnails));
}
foreach ($possibleThumbnails as $width => $path) {
if ($width < $maxX) {
continue;
@ -398,6 +382,8 @@ class Preview {
return $path;
}
}
return false;
}
/**