mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-09-29 06:28:37 +00:00
Use shallow search to improve performance
This commit is contained in:
@@ -1,17 +1,6 @@
|
||||
import AppKit
|
||||
|
||||
extension NSView {
|
||||
func firstSubview(withClassName name: String) -> NSView? {
|
||||
for subview in subviews {
|
||||
if String(describing: type(of: subview)) == name {
|
||||
return subview
|
||||
} else if let found = subview.firstSubview(withClassName: name) {
|
||||
return found
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func subviews(withClassName name: String) -> [NSView] {
|
||||
var result = [NSView]()
|
||||
|
Reference in New Issue
Block a user