Skip to content

Commit

Permalink
Improve memory usage at Eloquent/Builder/chunkById (#19368)
Browse files Browse the repository at this point in the history
* Improve memory usage

* StyleCI

* StyleCI
  • Loading branch information
driade authored and taylorotwell committed May 28, 2017
1 parent bd8cc3d commit 5f5c5e8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Illuminate/Database/Eloquent/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,8 @@ public function chunkById($count, callable $callback, $column = null, $alias = n
}

$lastId = $results->last()->{$alias};

unset($results);
} while ($countResults == $count);

return true;
Expand Down

0 comments on commit 5f5c5e8

Please sign in to comment.