diff --git a/src/Mustache/Compiler.php b/src/Mustache/Compiler.php index e22d02a..f7f1d31 100644 --- a/src/Mustache/Compiler.php +++ b/src/Mustache/Compiler.php @@ -141,6 +141,24 @@ class Mustache_Compiler %s }'; + const KLASS_NO_LAMBDAS = 'walk($tree); $sections = implode("\n", $this->sections); + $klass = empty($this->sections) ? self::KLASS_NO_LAMBDAS : self::KLASS; - return sprintf($this->prepare(self::KLASS, 0, false), $name, $code, $this->getEscape('$buffer'), $sections); + return sprintf($this->prepare($klass, 0, false), $name, $code, $this->getEscape('$buffer'), $sections); } const SECTION_CALL = '