Skip to content

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
alixander committed Oct 31, 2023
1 parent 75e8928 commit 8f89322
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions d2ir/d2ir.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,21 +318,11 @@ func (f *Field) Copy(newParent Node) Node {
}

func (f *Field) LastPrimaryRef() Reference {
var lastGlobSet Reference
for i := len(f.References) - 1; i >= 0; i-- {
if f.References[i].Primary() {
if f.References[i].DueToLazyGlob() {
if lastGlobSet == nil {
lastGlobSet = f.References[i]
}
} else {
return f.References[i]
}
return f.References[i]
}
}
if lastGlobSet != nil {
return lastGlobSet
}
return nil
}

Expand Down

0 comments on commit 8f89322

Please sign in to comment.