fixed recusrive call and SliceAppendUniq

This commit is contained in:
Christian Goll
2022-03-11 16:13:22 +01:00
parent 351b81b9e3
commit 29074f34ea
2 changed files with 5 additions and 5 deletions

View File

@@ -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 {

View File

@@ -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
}