mirror of
https://github.com/matrix-org/matrix-spec
synced 2026-01-08 17:03:42 +01:00
Use append instead of iteration to merge results
This commit is contained in:
parent
a5b281bf5e
commit
980dbfd969
|
|
@ -113,11 +113,9 @@
|
|||
{{ $this_object := partial "json-schema/resolve-allof" .this_object }}
|
||||
|
||||
{{ $more_objects := partial "json-schema/resolve-additional-types" (dict "schema" $this_object "anchor_base" .anchor_base "name" $name) }}
|
||||
{{/*
|
||||
As far as I know we don't have something like Array.concat(), so add them one at a time
|
||||
*/}}
|
||||
{{ range $more_objects }}
|
||||
{{ $additional_objects = $additional_objects | append . }}
|
||||
{{/* appending an empty slice messes up the types and confuses go, so only do the append if $more_objects is non-empty */}}
|
||||
{{ if $more_objects }}
|
||||
{{ $additional_objects = $additional_objects | append $more_objects }}
|
||||
{{ end }}
|
||||
{{ return $additional_objects }}
|
||||
{{ end }}
|
||||
|
|
|
|||
Loading…
Reference in a new issue