mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-03 01:44:26 +02:00
remove additional calls to getCached()
This commit is contained in:
1
TODO.txt
1
TODO.txt
@@ -3,7 +3,6 @@
|
|||||||
## Performance improvements
|
## Performance improvements
|
||||||
- context: pass template variables in an array
|
- context: pass template variables in an array
|
||||||
- why do we do 300k assign() calls? (answer: foreach?)
|
- why do we do 300k assign() calls? (answer: foreach?)
|
||||||
- debugging: see if removing debugging code speeds up
|
|
||||||
|
|
||||||
## Review direct variable property access
|
## Review direct variable property access
|
||||||
- review ->value{$index} in ForTag
|
- review ->value{$index} in ForTag
|
||||||
|
@@ -266,13 +266,14 @@ class Template extends TemplateBase {
|
|||||||
$tpl->defaultScope = $scope;
|
$tpl->defaultScope = $scope;
|
||||||
}
|
}
|
||||||
|
|
||||||
// recursive call ?
|
if ($caching) {
|
||||||
if ($tpl->templateId !== $this->templateId && $caching !== \Smarty\Template::CACHING_NOCACHE_CODE) {
|
if ($tpl->templateId !== $this->templateId && $caching !== \Smarty\Template::CACHING_NOCACHE_CODE) {
|
||||||
$tpl->getCached(true);
|
$tpl->getCached(true);
|
||||||
} else {
|
} else {
|
||||||
// re-use the same Cache object across subtemplates to gather hashes and file dependencies.
|
// re-use the same Cache object across subtemplates to gather hashes and file dependencies.
|
||||||
$tpl->setCached($this->getCached());
|
$tpl->setCached($this->getCached());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($extra_vars as $_key => $_val) {
|
foreach ($extra_vars as $_key => $_val) {
|
||||||
$tpl->assign($_key, $_val);
|
$tpl->assign($_key, $_val);
|
||||||
@@ -713,8 +714,10 @@ class Template extends TemplateBase {
|
|||||||
public function setCompileId($compile_id) {
|
public function setCompileId($compile_id) {
|
||||||
parent::setCompileId($compile_id);
|
parent::setCompileId($compile_id);
|
||||||
$this->getCompiled(true);
|
$this->getCompiled(true);
|
||||||
|
if ($this->caching) {
|
||||||
$this->getCached(true);
|
$this->getCached(true);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $cache_id
|
* @param string $cache_id
|
||||||
|
Reference in New Issue
Block a user