From: lenar Date: Thu, 28 Apr 2011 08:27:40 +0000 (+0300) Subject: fixes performance regression X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=04fcc0ca76d92e98bd971bbde58e3e0540b83915;p=web%2Fkonrad%2Ftwig.git fixes performance regression The regression was introduced by 1e09c7b660856b8178c1. --- diff --git a/lib/Twig/Environment.php b/lib/Twig/Environment.php index f2f4ce1..85cff2e 100644 --- a/lib/Twig/Environment.php +++ b/lib/Twig/Environment.php @@ -298,13 +298,11 @@ class Twig_Environment } if (!class_exists($cls, false)) { - $code = $this->compileSource($this->loader->getSource($name), $name); - if (false === $cache = $this->getCacheFilename($name)) { - eval('?>'.$code); + eval('?>'.$this->compileSource($this->loader->getSource($name), $name)); } else { if (!file_exists($cache) || ($this->isAutoReload() && !$this->loader->isFresh($name, filemtime($cache)))) { - $this->writeCacheFile($cache, $code); + $this->writeCacheFile($cache, $this->compileSource($this->loader->getSource($name), $name)); } require_once $cache;