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:
parent
35173cae82
commit
8e9f725301
1 changed files with 2 additions and 3 deletions
|
|
@ -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{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue