Skip to content

Commit 9cdd1ac

Browse files
simplify logic for CheckedIndex.primaryDefinitionOrDeclarationOccurrence(ofDocCSymbolLink:)
1 parent 0151774 commit 9cdd1ac

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Sources/DocCDocumentation/IndexStoreDB+Extensions.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ extension CheckedIndex {
4242
let symbolOccurences = topLevelSymbolOccurrences.filter { topLevelSymbolOccurrence in
4343
var components = components
4444
var symbolOccurrence = topLevelSymbolOccurrence
45-
while let parentSymbolOccurrence = symbolOccurrence.parent(self), !components.isEmpty {
46-
let nextComponent = components.removeLast()
45+
while let nextComponent = components.popLast(), let parentSymbolOccurrence = symbolOccurrence.parent(self) {
4746
let parentSymbolInformation = LinkCompletionTools.SymbolInformation(
4847
fromSymbolOccurrence: parentSymbolOccurrence
4948
)

0 commit comments

Comments
 (0)