made a small optimization
authorFabien Potencier <fabien.potencier@gmail.com>
Mon, 10 May 2010 15:21:55 +0000 (17:21 +0200)
committerFabien Potencier <fabien.potencier@gmail.com>
Mon, 10 May 2010 15:21:55 +0000 (17:21 +0200)
lib/Twig/Lexer.php

index 7d0a85f..3fa314f 100644 (file)
@@ -65,7 +65,7 @@ class Twig_Lexer implements Twig_LexerInterface
       mb_internal_encoding('ASCII');
     }
 
-    $this->code = preg_replace('/(\r\n|\r|\n)/', "\n", $code);
+    $this->code = str_replace(array("\r\n", "\r"), "\n", $code);
     $this->filename = $filename;
     $this->cursor = 0;
     $this->lineno = 1;