Browse Source

[DependencyInjection] Regex optimization

Jordi Boggiano 14 years ago
parent
commit
48155ccc2f
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/Symfony/Component/DependencyInjection/Container.php

+ 1 - 1
src/Symfony/Component/DependencyInjection/Container.php

@@ -282,7 +282,7 @@ class Container implements ContainerInterface, \ArrayAccess
 
     static public function camelize($id)
     {
-        return preg_replace(array('/(^|_)+(.)/e', '/\.(.)/e'), array("strtoupper('\\2')", "'_'.strtoupper('\\1')"), $id);
+        return preg_replace(array('/(?:^|_)+(.)/e', '/\.(.)/e'), array("strtoupper('\\1')", "'_'.strtoupper('\\1')"), $id);
     }
 
     static public function underscore($id)