Skip to content
This repository has been archived by the owner on Mar 11, 2021. It is now read-only.

Commit

Permalink
Used id.Slice.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelkleinhenz committed Aug 27, 2018
1 parent 5b4d19c commit 4764322
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion actions/rules/action_state_to_metastate.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"encoding/json"
"github.com/fabric8-services/fabric8-wit/actions/change"
"github.com/fabric8-services/fabric8-wit/id"

errs "github.com/pkg/errors"
uuid "github.com/satori/go.uuid"
Expand All @@ -22,6 +23,7 @@ type ActionStateToMetaState struct {
// make sure the rule is implementing the interface.
var _ Action = ActionStateToMetaState{}

/*
func (act ActionStateToMetaState) containsUUID(s []uuid.UUID, e uuid.UUID) bool {
for _, a := range s {
if a == e {
Expand All @@ -30,6 +32,7 @@ func (act ActionStateToMetaState) containsUUID(s []uuid.UUID, e uuid.UUID) bool
}
return false
}
*/

func (act ActionStateToMetaState) contains(s []interface{}, e interface{}) bool {
for _, a := range s {
Expand Down Expand Up @@ -380,7 +383,8 @@ func (act ActionStateToMetaState) onStateChange(newContext change.Detector, cont
return nil, nil, err
}
for _, group := range groups {
if group.ID == thisBoardContext && act.containsUUID(group.TypeList, wi.Type) {
var typeListSlice id.Slice = group.TypeList
if group.ID == thisBoardContext && typeListSlice.Contains(wi.Type) {
// this board is relevant.
relevantBoards = append(relevantBoards, board)
}
Expand Down

0 comments on commit 4764322

Please sign in to comment.