1
0
mirror of synced 2024-12-05 03:06:05 +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(); $result = array();
foreach ($collection->identifiers as $key) { foreach ($collection->identifiers as $key) {
$entry = $this->cache->fetch($this->getCacheEntryKey($key)); $entryKey = $this->getCacheEntryKey($key);
if ($entry === false) { $entryValue = $this->cache->fetch($entryKey);
$result = null;
break; if ($entryValue === false) {
} else { return null;
$result[] = $entry;
} }
$result[] = $entryValue;
} }
return $result; return $result;