A hyphen (or dash) at the end of a Twig block means to trim trailing whitespace, at the beginning, leading whitespace. Both means… both.
See the Whitespace Control section of the docs; their example:
{% set value="no spaces" %}
{#- No leading/trailing whitespace -#}
{%- if true -%}
{{- value -}}
{%- endif -%}
{# output 'no spaces' #}
<li>
{{ value }} </li>
{# outputs '<li>\n no spaces </li>' #}
<li>
{{- value }} </li>
{# outputs '<li>no spaces </li>' #}
<li>
{{~ value }} </li>
{# outputs '<li>\no spaces </li>' #}