Skip to content
Permalink
Browse files

Use foreach instead of array_filter.

This allows the loop to be broken on the first non null element.
  • Loading branch information...
markstory committed Jul 10, 2014
1 parent 3410911 commit 2c36545960acbdf32a48b9aa852deb85a3f4c52a
Showing with 7 additions and 3 deletions.
  1. +7 −3 src/ORM/ResultSet.php
@@ -401,9 +401,13 @@ protected function _groupResult($row) {
if ($assoc['canBeJoined']) {
$results[$alias] = $this->_castValues($target, $results[$alias]);
$hasData = array_filter($results[$alias], function ($v) {
return $v !== null;
});
$hasData = false;
foreach ($results[$alias] as $v) {
if ($v !== null) {
$hasData = true;
break;
}
}
if (!$hasData) {
continue;

0 comments on commit 2c36545

Please sign in to comment.
You can’t perform that action at this time.