Skip to content

Commit 68bb59d

Browse files
authored
Use the identifier from the lookup's key instead of the node (#1200) (#1204)
rdar://148504975
1 parent 687bc8f commit 68bb59d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Sources/SwiftDocC/Infrastructure/Link Resolution/PathHierarchy+Serialization.swift

+4-2
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,11 @@ extension PathHierarchy.FileRepresentation {
3737
}
3838

3939
let nodes = [Node](unsafeUninitializedCapacity: lookup.count) { buffer, initializedCount in
40-
for node in lookup.values {
40+
for (identifier, node) in lookup {
41+
assert(identifier == node.identifier, "Every node lookup should match a node with that identifier.")
42+
4143
buffer.initializeElement(
42-
at: identifierMap[node.identifier]!,
44+
at: identifierMap[identifier]!,
4345
to: Node(
4446
name: node.name,
4547
rawSpecialBehavior: node.specialBehaviors.rawValue,

0 commit comments

Comments
 (0)