1
0
mirror of synced 2024-12-04 18:56:06 +03:00

Use early return

This commit is contained in:
Menno Holtkamp 2015-04-14 16:02:36 +02:00
parent 34b6ce9259
commit 5f891435f1

View File

@ -105,13 +105,14 @@ class DefaultRegion implements Region
$result = array();
foreach ($collection->identifiers as $key) {
$entry = $this->cache->fetch($this->getCacheEntryKey($key));
if ($entry === false) {
$result = null;
break;
} else {
$result[] = $entry;
$entryKey = $this->getCacheEntryKey($key);
$entryValue = $this->cache->fetch($entryKey);
if ($entryValue === false) {
return null;
}
$result[] = $entryValue;
}
return $result;