-
Sub-task
-
Resolution: Fixed
-
Minor
-
2.4.3, 2.5
-
None
-
MOODLE_24_STABLE, MOODLE_25_STABLE
-
MOODLE_24_STABLE
-
MDL-39452-master -
The html_writer::attribute function is called thousands of times on typical pages (1,271 times on the one I'm testing, to be exact).
This function includes a check, with developer debug warning, for if some idiot passes an array for the attribute value.
Since the check has been there since html_writer was invented (actually before), I think people should really have noticed the developer debug warning now, and this code should be removed.
According to my profiling this check adds ~2ms to a page load on OU systems. Not a lot but a pretty big chunk just for a never-used dev debug warning.
(Note: I'm totally in favour of dev debug checks usually, just not in functions that are called thousands of times on many pages across the system.)