mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-16 04:16:28 +00:00
made a small performance improvement
This commit is contained in:
@@ -160,6 +160,8 @@ final class Twig_ExtensionSet
|
||||
throw new LogicException(sprintf('Unable to register extension "%s" as it is already registered.', $class));
|
||||
}
|
||||
|
||||
// For BC/FC with namespaced aliases
|
||||
$class = (new ReflectionClass($class))->name;
|
||||
$this->extensions[$class] = $extension;
|
||||
}
|
||||
|
||||
|
||||
@@ -41,11 +41,7 @@ abstract class Twig_Template
|
||||
public function __construct(Twig_Environment $env)
|
||||
{
|
||||
$this->env = $env;
|
||||
foreach ($env->getExtensions() as $extension) {
|
||||
// For BC/FC with namespaced aliases
|
||||
$class = (new ReflectionClass(get_class($extension)))->name;
|
||||
$this->extensions[ltrim($class, '\\')] = $extension;
|
||||
}
|
||||
$this->extensions = $env->getExtensions();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user