Avoid unnecessary line indentation calculation.

This commit is contained in:
Alex Pott 2014-02-23 10:43:36 +00:00 committed by Fabien Potencier
parent d5aca818b2
commit 5e9f41eef4

View File

@ -312,7 +312,9 @@ class Parser
$removeComments = !preg_match($removeCommentsPattern, $this->currentLine);
while ($this->moveToNextLine()) {
if ($this->getCurrentLineIndentation() === $newIndent) {
$indent = $this->getCurrentLineIndentation();
if ($indent === $newIndent) {
$removeComments = !preg_match($removeCommentsPattern, $this->currentLine);
}
@ -329,8 +331,6 @@ class Parser
continue;
}
$indent = $this->getCurrentLineIndentation();
if (preg_match('#^(?P<text> *)$#', $this->currentLine, $match)) {
// empty line
$data[] = $match['text'];