Skip to content

Commit

Permalink
perf(map.jinja): remove inactive files from formulas dict before merging
Browse files Browse the repository at this point in the history
  • Loading branch information
myii committed Oct 13, 2019
1 parent d462a93 commit 7fb97fe
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ssf/map.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@
{%- endif %}
{%- endfor %}

{#- Reduce dict sizes further, by removing files that aren't active #}
{%- for k, v in formulas[tplroot].semrel_formulas.items() %}
{%- for f_k, f_v in v.semrel_files.items() %}
{%- if f_k not in config.active.semrel_files %}
{%- do formulas[tplroot].semrel_formulas[k].semrel_files.pop(f_k, None) %}
{%- endif %}
{%- endfor %}
{%- endfor %}

{#- Merge the formulas #}
{%- do salt['defaults.merge'](defaults, formulas) %}

Expand Down

0 comments on commit 7fb97fe

Please sign in to comment.