minor #4346 Remove useless assign in compiled code (ruudk)

This PR was merged into the 3.x branch.

Discussion
----------

Remove useless assign in compiled code

It's already unset / initialized on catch.

Having it this way, is a bit easier for me when analyzing this in TwigStan.

Commits
-------

5c73c6695c Remove useless assign in compiled code
This commit is contained in:
Fabien Potencier
2024-09-26 15:10:13 +02:00
2 changed files with 0 additions and 2 deletions
-1
View File
@@ -42,7 +42,6 @@ class IncludeNode extends Node implements NodeOutputInterface
$template = $compiler->getVarName();
$compiler
->write(\sprintf("$%s = null;\n", $template))
->write("try {\n")
->indent()
->write(\sprintf('$%s = ', $template))
-1
View File
@@ -78,7 +78,6 @@ EOF
$node = new IncludeNode($expr, $vars, true, true, 1);
$tests[] = [$node, <<<EOF
// line 1
\$__internal_%s = null;
try {
\$__internal_%s = \$this->loadTemplate("foo.twig", null, 1);
} catch (LoaderError \$e) {