From bf603b51dbdeb054265ba1072e4d2e1b39cd88e7 Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Sat, 3 Jun 2023 12:05:42 +0100 Subject: [PATCH] wip --- Sources/Introspect.swift | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Sources/Introspect.swift b/Sources/Introspect.swift index f78bec6..0edf3bd 100644 --- a/Sources/Introspect.swift +++ b/Sources/Introspect.swift @@ -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) } }