浏览代码

[DependencyInjection] Regex optimization

Jordi Boggiano 14 年之前
父节点
当前提交
48155ccc2f
共有 1 个文件被更改,包括 1 次插入1 次删除
  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)