File tree Expand file tree Collapse file tree 1 file changed +5
-11
lines changed
Sources/DocCDocumentation Expand file tree Collapse file tree 1 file changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -44,18 +44,12 @@ package struct DocCSymbolInformation {
4444 }
4545
4646 package func matches( _ link: DocCSymbolLink ) -> Bool {
47- var linkComponents = link. components
48- var symbolComponents = components
49- while !linkComponents. isEmpty, !symbolComponents. isEmpty {
50- let nextLinkComponent = linkComponents. removeLast ( )
51- let nextSymbolComponent = symbolComponents. removeLast ( )
52- guard nextLinkComponent. name == nextSymbolComponent. name,
53- nextSymbolComponent. information. matches ( nextLinkComponent. disambiguation)
54- else {
55- return false
56- }
47+ guard link. components. count == components. count else {
48+ return false
49+ }
50+ return zip ( link. components, components) . allSatisfy { linkComponent, symbolComponent in
51+ linkComponent. name == symbolComponent. name && symbolComponent. information. matches ( linkComponent. disambiguation)
5752 }
58- return true
5953 }
6054}
6155
You can’t perform that action at this time.
0 commit comments