We do not set S_NUM_ROWS while adding a row, to reduce the complexity
If we would set it on adding, each subsequent adding would cause
n modifications, resulting in a O(n!) complexity, rather then O(n)
PHPBB3-12892
The size of the template block array is calculated within a foreach loop
iterating through the array, which is unnecessary. It only needs to be done
once. In a block of 1000 rows, this results in
500,500 calls to sizeof() in this location. With this change, that's reduced to
1000.
PHPBB3-12232
Add one more wrapper template method for the function assign_block_vars() which
takes a 2-dimensional array as a parameter
and calls assign_block_vars() in a loop to assign the whole block loop at once.
This can make the core a little bit more expendable from the point of
developing extensions as it allows to pass the data to events before
it's being assigned to template.
PHPBB3-12224