weldr: fix minor inefficiency in composeStatusHandler

`uuids` was initialized with a length, but only appended to. This lead
to a slice with lots of empty uuids, followed by the actual ones.

Fix this by initializing to an empty slice.

This happened to work because there's a non-fatal check for non-existing
composes further down, and the empty string fails that test.
This commit is contained in:
Lars Karlitski 2020-04-28 09:10:51 +02:00 committed by Tom Gundersen
parent 35173cae82
commit 8e9f725301

View file

@ -1634,9 +1634,8 @@ func (api *API) composeStatusHandler(writer http.ResponseWriter, request *http.R
var uuids []uuid.UUID
if uuidsParam != "*" {
uuidStrings := strings.Split(uuidsParam, ",")
uuids = make([]uuid.UUID, len(uuidStrings))
for _, uuidString := range uuidStrings {
uuids = []uuid.UUID{}
for _, uuidString := range strings.Split(uuidsParam, ",") {
id, err := uuid.Parse(uuidString)
if err != nil {
errors := responseError{