cleanup: Avoid nested if statment

Co-authored-by: Andre Duffeck <aduffeck@users.noreply.github.com>
This commit is contained in:
Ralf Haferkamp
2025-06-03 09:02:56 +02:00
committed by GitHub
parent a73b125505
commit 3569a36c1b

View File

@@ -34,10 +34,10 @@ func collectExpandPaths(item *godata.ExpandItem, prefix string) ([]string, error
// Build the current path
currentPath := prefix
if len(item.Path) > 0 {
if len(item.Path) > 1 {
return nil, godata.NotImplementedError("multiple segments in $expand not supported")
}
if len(item.Path) > 1 {
return nil, godata.NotImplementedError("multiple segments in $expand not supported")
}
if len(item.Path) == 1 {
if currentPath == "" {
currentPath = item.Path[0].Value
} else {