Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only push the block's parent path onto the stack once during execution #1176

Merged
merged 1 commit into from
May 7, 2024

Conversation

jasmith-hs
Copy link
Contributor

@jasmith-hs jasmith-hs commented May 6, 2024

As I was going to edit some of the logic here for eager execution, I found this redundant logic which pushes and pops the parent path for every node within a block, rather than just doing it once per block.

For instance, if I had a block:

{% block %}
  Hi
  {% if hungry %}
    hungry,
  {% endif %}
  I'm dad!
{% endblock %}

The current logic pushes/pops the parent path for each: Hi, {% if hungry %}, I'm dad!.
Instead, we can just do this once outside the for loop.

The logic was originally added in #363, and there's no need to do it once per node.

@jasmith-hs jasmith-hs merged commit c3b3fea into master May 7, 2024
5 checks passed
@jasmith-hs jasmith-hs deleted the push-path-once-in-block branch May 7, 2024 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant