From 7da7183a37e069cadd8a6e9b61a640c7a746570b Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Wed, 9 May 2018 19:07:38 +0000 Subject: [PATCH] Refactor: simplify default type of option --- app/api_topologies.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/app/api_topologies.go b/app/api_topologies.go index 5618a6d9d..047341a5d 100644 --- a/app/api_topologies.go +++ b/app/api_topologies.go @@ -328,18 +328,14 @@ type APITopologyOptionGroup struct { // Get the render filters to use for this option group, if any, or nil otherwise. func (g APITopologyOptionGroup) filter(value string) render.FilterFunc { - selectType := g.SelectType - if selectType == "" { - selectType = "one" - } var values []string - switch selectType { - case "one": + switch g.SelectType { + case "", "one": values = []string{value} case "union": values = strings.Split(value, ",") default: - log.Errorf("Invalid select type %s for option group %s, ignoring option", selectType, g.ID) + log.Errorf("Invalid select type %s for option group %s, ignoring option", g.SelectType, g.ID) return nil } filters := []render.FilterFunc{}