Skip to content

Commit fb3f6e2

Browse files
authored
Merge pull request #585 from ahoppen/pr/remove-redundant-cycle-check
Remove redundant assertion for cyclic SyntaxArenas
2 parents 36482ae + 019355d commit fb3f6e2

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

Sources/SwiftSyntax/SyntaxArena.swift

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,7 @@ public class SyntaxArena {
123123
precondition(
124124
!self.hasParent,
125125
"an arena can't have a new child once it's owned by other arenas")
126-
// `precondition(!self.hasParent)` should be sufficient to make sure we
127-
// don’t add retain cycles between syntax arenas, but to be doubly sure,
128-
// check the child arenas as well in debug builds.
129-
assert(!other.contains(arena: self), "cyclic arena hierarchy detected")
130-
126+
131127
other.hasParent = true
132128
children.insert(other)
133129
}

0 commit comments

Comments
 (0)