From: Armin Ronacher Date: Sun, 25 Oct 2009 12:03:08 +0000 (+0100) Subject: Shortcut for the if inner visit for empty branches. X-Git-Tag: 2.3~48 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1965e31075515c6b261a709e08314943b97a9498;p=jinja2.git Shortcut for the if inner visit for empty branches. --HG-- branch : trunk --- diff --git a/jinja2/compiler.py b/jinja2/compiler.py index 2dd68cd..a6f26a5 100644 --- a/jinja2/compiler.py +++ b/jinja2/compiler.py @@ -278,6 +278,8 @@ class FrameIdentifierVisitor(NodeVisitor): real_identifiers.declared_parameter def inner_visit(nodes): + if not nodes: + return set() self.identifiers = real_identifiers.copy() for subnode in nodes: self.visit(subnode)