Skip to content

Commit

Permalink
perf(map.jinja): reduce re-looping required for removing inactive files
Browse files Browse the repository at this point in the history
  • Loading branch information
myii committed Oct 13, 2019
1 parent 7fb97fe commit 194e793
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions ssf/map.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,16 @@
{%- for k, v in formulas[tplroot].semrel_formulas.items() %}
{%- if k not in config.active.semrel_formulas %}
{%- do formulas[tplroot].semrel_formulas.pop(k, None) %}
{%- else %}
{#- Reduce dict sizes further, by removing files that aren't active #}
{%- 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 %}
{%- 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 194e793

Please sign in to comment.