Skip to content

Commit

Permalink
speed up unfiltered search
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnEstropia committed Feb 20, 2024
1 parent b18ebd5 commit f79676b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Sources/StorybookKit/Internals/machOLoader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ extension Book {
return nil
}
guard
contextDescriptor.pointee.kind().canConformToProtocol,
!filterByStorybookPageMacro || self._magicSubstring.withCString(
{
let nameCString = contextDescriptor.resolvePointer(for: \.name)
Expand Down Expand Up @@ -265,5 +266,9 @@ struct SwiftTypeContextDescriptor: SwiftLayoutPointer {
init(rawValue: UInt32) {
self.rawValue = rawValue
}

var canConformToProtocol: Bool {
return (Self.classType.rawValue ... Self.typesEnd.rawValue).contains(self.rawValue)
}
}
}

0 comments on commit f79676b

Please sign in to comment.