Skip to content

Commit

Permalink
MDL-64818 blocks: blocks_for_region() is inefficient.
Browse files Browse the repository at this point in the history
  • Loading branch information
gjb2048 committed Aug 7, 2020
1 parent a7d9b53 commit da4ded8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/outputrenderers.php
Expand Up @@ -1817,11 +1817,12 @@ public function list_block_contents($icons, $items) {
*/
public function blocks_for_region($region) {
$blockcontents = $this->page->blocks->get_content_for_region($region, $this);
$blocks = $this->page->blocks->get_blocks_for_region($region);
$lastblock = null;
$zones = array();
foreach ($blocks as $block) {
$zones[] = $block->title;
foreach ($blockcontents as $bc) {
if ($bc instanceof block_contents) {
$zones[] = $bc->title;
}
}
$output = '';

Expand Down

0 comments on commit da4ded8

Please sign in to comment.