This commit is contained in:
David Roman 2023-06-03 12:05:42 +01:00
parent 43a8b9cfe8
commit bf603b51db
No known key found for this signature in database
GPG Key ID: 7058646EEFCB70A7
1 changed files with 4 additions and 7 deletions

View File

@ -95,18 +95,15 @@ extension PlatformEntity {
@_spi(Internals)
public func descendantsBetween(_ bottomEntity: Base, and topEntity: Base) -> [Base] {
var entered = false
var result: [Base] = []
var entered = false
for descendant in self.allDescendants {
if descendant === bottomEntity {
entered = true
continue
}
if descendant === topEntity {
return result
}
if entered {
} else if descendant === topEntity {
break
} else if entered {
result.append(descendant)
}
}