mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-13 05:06:37 +02:00
Merge pull request #2065 from prototech/ticket/12232
[ticket/12232] Remove excessive calls to sizeof() in assign_block_vars() method.
This commit is contained in:
@ -155,11 +155,12 @@ class context
|
|||||||
// We're adding a new iteration to this block with the given
|
// We're adding a new iteration to this block with the given
|
||||||
// variable assignments.
|
// variable assignments.
|
||||||
$str[$blocks[$blockcount]][] = $vararray;
|
$str[$blocks[$blockcount]][] = $vararray;
|
||||||
|
$s_num_rows = sizeof($str[$blocks[$blockcount]]);
|
||||||
|
|
||||||
// Set S_NUM_ROWS
|
// Set S_NUM_ROWS
|
||||||
foreach ($str[$blocks[$blockcount]] as &$mod_block)
|
foreach ($str[$blocks[$blockcount]] as &$mod_block)
|
||||||
{
|
{
|
||||||
$mod_block['S_NUM_ROWS'] = sizeof($str[$blocks[$blockcount]]);
|
$mod_block['S_NUM_ROWS'] = $s_num_rows;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -186,11 +187,12 @@ class context
|
|||||||
|
|
||||||
// Add a new iteration to this block with the variable assignments we were given.
|
// Add a new iteration to this block with the variable assignments we were given.
|
||||||
$this->tpldata[$blockname][] = $vararray;
|
$this->tpldata[$blockname][] = $vararray;
|
||||||
|
$s_num_rows = sizeof($this->tpldata[$blockname]);
|
||||||
|
|
||||||
// Set S_NUM_ROWS
|
// Set S_NUM_ROWS
|
||||||
foreach ($this->tpldata[$blockname] as &$mod_block)
|
foreach ($this->tpldata[$blockname] as &$mod_block)
|
||||||
{
|
{
|
||||||
$mod_block['S_NUM_ROWS'] = sizeof($this->tpldata[$blockname]);
|
$mod_block['S_NUM_ROWS'] = $s_num_rows;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user