Switch condition and returns.

This commit is contained in:
Žan V. Dragan 2025-01-19 13:05:58 +01:00
parent 90335672a9
commit 4d65edfb54

View file

@ -500,11 +500,11 @@ func (c *Command) SuggestFunc(typedName string) string {
if parent.suggestFunc != nil {
return parent.suggestFunc
}
if parent.HasParent() {
return getParentFunc(parent.Parent())
}
if !parent.HasParent() {
return nil
}
return getParentFunc(parent.Parent())
}
parentFunc := getParentFunc(c.Parent())
if parentFunc != nil {
return parentFunc(typedName)