1
0
mirror of https://github.com/erusev/parsedown.git synced 2023-08-10 21:13:06 +03:00

Early exit if found

This commit is contained in:
Aidan Woods 2019-02-10 19:27:14 +00:00
parent 3bb24c20a6
commit 5ecfc42728
No known key found for this signature in database
GPG Key ID: 9A6A8EFAA512BBB9

View File

@ -26,21 +26,18 @@ final class Lines
$this->trailingBlankLinesText = $trailingBlankLinesText; $this->trailingBlankLinesText = $trailingBlankLinesText;
$this->trailingBlankLines = \substr_count($trailingBlankLinesText, "\n"); $this->trailingBlankLines = \substr_count($trailingBlankLinesText, "\n");
$this->containsBlankLines = ( $containsBlankLines = $this->trailingBlankLines > 0;
($this->trailingBlankLines > 0)
|| \array_reduce( if (! $containsBlankLines) {
$Contexts, foreach ($Contexts as $Context) {
/** if ($Context->previousEmptyLines() > 0) {
* @param bool $blankFound $containsBlankLines = true;
* @param Context $Context break;
* @return bool }
*/ }
function ($blankFound, $Context) { }
return $blankFound || ($Context->previousEmptyLines() > 0);
}, $this->containsBlankLines = $containsBlankLines;
false
)
);
} }
/** @return self */ /** @return self */