Skip to content

Commit

Permalink
array_shift » unset to simplify code base and improve performance
Browse files Browse the repository at this point in the history
  • Loading branch information
erusev committed Nov 17, 2013
1 parent b91629a commit a9d6232
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Parsedown.php
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ private function parse_block_elements(array $lines, $context = '')
}
}

# li
# li

if ($deindented_line[0] <= '9' and $deindented_line >= '0' and preg_match('/^([ ]*)\d+[.][ ](.*)/', $line, $matches))
{
Expand Down Expand Up @@ -483,15 +483,15 @@ private function parse_block_elements(array $lines, $context = '')

$elements []= $element;

array_shift($elements);
unset($elements[0]);

#
# ~
#

$markup = '';

foreach ($elements as $index => $element)
foreach ($elements as $element)
{
switch ($element['type'])
{
Expand All @@ -501,7 +501,7 @@ private function parse_block_elements(array $lines, $context = '')

$text = preg_replace('/[ ]{2}\n/', '<br />'."\n", $text);

if ($context === 'li' and $index === 0)
if ($context === 'li' and $markup === '')
{
if (isset($element['interrupted']))
{
Expand Down

0 comments on commit a9d6232

Please sign in to comment.