mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
This is probably faster than duplicating the closure
This commit is contained in:
parent
9026b1abdb
commit
390fa0da1b
@ -1614,10 +1614,13 @@ class Parsedown
|
||||
|
||||
protected function elementsApplyRecursive($closure, array $Elements)
|
||||
{
|
||||
return array_map(
|
||||
array($this, 'elementApplyRecursive'),
|
||||
array_fill(0, count($Elements), $closure),
|
||||
$Elements
|
||||
return array_reduce(
|
||||
$Elements,
|
||||
function (array $Elements, array $Element) use ($closure) {
|
||||
$Elements[] = $this->elementApplyRecursive($closure, $Element);
|
||||
return $Elements;
|
||||
},
|
||||
array()
|
||||
);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user