From 04fcc0ca76d92e98bd971bbde58e3e0540b83915 Mon Sep 17 00:00:00 2001 From: lenar Date: Thu, 28 Apr 2011 11:27:40 +0300 Subject: [PATCH] fixes performance regression The regression was introduced by 1e09c7b660856b8178c1. --- lib/Twig/Environment.php | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-) 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; -- 1.7.2.5