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
|
||||
- context: pass template variables in an array
|
||||
- why do we do 300k assign() calls? (answer: foreach?)
|
||||
- debugging: see if removing debugging code speeds up
|
||||
|
||||
## Review direct variable property access
|
||||
- review ->value{$index} in ForTag
|
||||
|
@@ -266,12 +266,13 @@ class Template extends TemplateBase {
|
||||
$tpl->defaultScope = $scope;
|
||||
}
|
||||
|
||||
// recursive call ?
|
||||
if ($tpl->templateId !== $this->templateId && $caching !== \Smarty\Template::CACHING_NOCACHE_CODE) {
|
||||
$tpl->getCached(true);
|
||||
} else {
|
||||
// re-use the same Cache object across subtemplates to gather hashes and file dependencies.
|
||||
$tpl->setCached($this->getCached());
|
||||
if ($caching) {
|
||||
if ($tpl->templateId !== $this->templateId && $caching !== \Smarty\Template::CACHING_NOCACHE_CODE) {
|
||||
$tpl->getCached(true);
|
||||
} else {
|
||||
// re-use the same Cache object across subtemplates to gather hashes and file dependencies.
|
||||
$tpl->setCached($this->getCached());
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($extra_vars as $_key => $_val) {
|
||||
@@ -713,7 +714,9 @@ class Template extends TemplateBase {
|
||||
public function setCompileId($compile_id) {
|
||||
parent::setCompileId($compile_id);
|
||||
$this->getCompiled(true);
|
||||
$this->getCached(true);
|
||||
if ($this->caching) {
|
||||
$this->getCached(true);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user