Просмотр исходного кода

[Yaml] made a small optimization

Fabien Potencier 13 лет назад
Родитель
Сommit
12a852e18b
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      src/Symfony/Component/Yaml/Parser.php

+ 1 - 1
src/Symfony/Component/Yaml/Parser.php

@@ -66,7 +66,7 @@ class Parser
             }
             }
 
 
             // tab?
             // tab?
-            if (preg_match('#^\t+#', $this->currentLine)) {
+            if ("\t" === $this->currentLine[0]) {
                 throw new ParseException('A YAML file cannot contain tabs as indentation.', $this->getRealCurrentLineNb() + 1, $this->currentLine);
                 throw new ParseException('A YAML file cannot contain tabs as indentation.', $this->getRealCurrentLineNb() + 1, $this->currentLine);
             }
             }