Permalink
Browse files

Avoid unnecessary line indentation calculation.

  • Loading branch information...
1 parent c65a647 commit 10c898d106ebc70f2e1d1b2aeec91cdae48397a2 Alex Pott committed Feb 23, 2014
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/Symfony/Component/Yaml/Parser.php
@@ -312,7 +312,9 @@ private function getNextEmbedBlock($indentation = null)
$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 @@ private function getNextEmbedBlock($indentation = null)
continue;
}
- $indent = $this->getCurrentLineIndentation();
-
if (preg_match('#^(?P<text> *)$#', $this->currentLine, $match)) {
// empty line
$data[] = $match['text'];

0 comments on commit 10c898d

Please sign in to comment.