8000 Avoid unnecessary line indentation calculation. · symfony/symfony@5e9f41e · GitHub
[go: up one dir, main page]

Skip to content

Commit 5e9f41e

Browse files
alexpottfabpot
authored andcommitted
Avoid unnecessary line indentation calculation.
1 parent d5aca81 commit 5e9f41e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Symfony/Component/Yaml/Parser.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,9 @@ private function getNextEmbedBlock($indentation = null)
312312
$removeComments = !preg_match($removeCommentsPattern, $this->currentLine);
313313

314314
while ($this->moveToNextLine()) {
315-
if ($this->getCurrentLineIndentation() === $newIndent) {
315+
$indent = $this->getCurrentLineIndentation();
316+
317+
if ($indent === $newIndent) {
316318
$removeComments = !preg_match($removeCommentsPattern, $this->currentLine);
317319
}
318320

@@ -329,8 +331,6 @@ private function getNextEmbedBlock($indentation = null)
329331
continue;
330332
}
331333

332-
$indent = $this->getCurrentLineIndentation();
333-
334334
if (preg_match('#^(?P<text> *)$#', $this->currentLine, $match)) {
335335
// empty line
336336
$data[] = $match['text'];

0 commit comments

Comments
 (0)
0