File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ private func NSThreadStart(_ context: UnsafeMutablePointer<Void>?) -> UnsafeMuta
5959public class Thread : NSObject {
6060
6161 static internal var _currentThread = NSThreadSpecific < Thread > ( )
62- public static func current( ) -> Thread {
62+ public static var current : Thread {
6363 return Thread . _currentThread. get ( ) {
6464 return Thread ( thread: pthread_self ( ) )
6565 }
Original file line number Diff line number Diff line change @@ -460,7 +460,7 @@ public class XMLParser : NSObject {
460460 public var allowedExternalEntityURLs : Set < URL > ?
461461
462462 internal static func currentParser( ) -> XMLParser ? {
463- if let current = Thread . current ( ) . threadDictionary [ " __CurrentNSXMLParser " ] {
463+ if let current = Thread . current. threadDictionary [ " __CurrentNSXMLParser " ] {
464464 return current as? XMLParser
465465 } else {
466466 return nil
@@ -469,9 +469,9 @@ public class XMLParser : NSObject {
469469
470470 internal static func setCurrentParser( _ parser: XMLParser ? ) {
471471 if let p = parser {
472- Thread . current ( ) . threadDictionary [ " __CurrentNSXMLParser " ] = p
472+ Thread . current. threadDictionary [ " __CurrentNSXMLParser " ] = p
473473 } else {
474- Thread . current ( ) . threadDictionary. removeValue ( forKey: " __CurrentNSXMLParser " )
474+ Thread . current. threadDictionary. removeValue ( forKey: " __CurrentNSXMLParser " )
475475 }
476476 }
477477
Original file line number Diff line number Diff line change @@ -26,8 +26,8 @@ class TestNSThread : XCTestCase {
2626 }
2727
2828 func test_currentThread( ) {
29- let thread1 = Thread . current ( )
30- let thread2 = Thread . current ( )
29+ let thread1 = Thread . current
30+ let thread2 = Thread . current
3131 XCTAssertNotNil ( thread1)
3232 XCTAssertNotNil ( thread2)
3333 XCTAssertEqual ( thread1, thread2)
You can’t perform that action at this time.
0 commit comments