From 29074f34ea40a137951ebed4e24a6bfad33c0c77 Mon Sep 17 00:00:00 2001 From: Christian Goll Date: Fri, 11 Mar 2022 16:13:22 +0100 Subject: [PATCH] fixed recusrive call and SliceAppendUniq --- internal/pkg/node/methods.go | 6 +++--- internal/pkg/util/util.go | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/pkg/node/methods.go b/internal/pkg/node/methods.go index c8c65fd6..118cc59a 100644 --- a/internal/pkg/node/methods.go +++ b/internal/pkg/node/methods.go @@ -158,10 +158,10 @@ func (ent *Entry) Print() string { } func (ent *Entry) PrintComb() string { - if ent.value != "" && ent.def != "" { - return "[" + ent.value + "," + ent.def + "]" + if ent.value != "" && ent.altvalue != "" { + return "[" + ent.value + "," + ent.altvalue + "]" } - return ent.PrintComb() + return ent.Print() } func (ent *Entry) PrintB() bool { diff --git a/internal/pkg/util/util.go b/internal/pkg/util/util.go index 8ac47207..e9b69f44 100644 --- a/internal/pkg/util/util.go +++ b/internal/pkg/util/util.go @@ -229,9 +229,9 @@ func SliceAddUniqueElement(array []string, add string) []string { Appends a string slice to another slice. Guarantess that the elements are uniq. */ func SliceAppendUniq(array []string, add []string) []string { - var ret []string + ret := array for _, r := range add { - ret = SliceAddUniqueElement(array, r) + ret = SliceAddUniqueElement(ret, r) } return ret }