From 29dcaa2e1b9bdd08344c286f26c9c3b75e5d8063 Mon Sep 17 00:00:00 2001 From: sanghun0724 Date: Thu, 4 Jan 2024 18:51:22 +0900 Subject: [PATCH] Remove unused additional nil coalescing --- ios/RIBs/Classes/DI/Component.swift | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/ios/RIBs/Classes/DI/Component.swift b/ios/RIBs/Classes/DI/Component.swift index 4a178ff58..6c0d7cc3e 100644 --- a/ios/RIBs/Classes/DI/Component.swift +++ b/ios/RIBs/Classes/DI/Component.swift @@ -49,11 +49,7 @@ open class Component: Dependency { lock.unlock() } - // Additional nil coalescing is needed to mitigate a Swift bug appearing in Xcode 10. - // see https://bugs.swift.org/browse/SR-8704. - // Without this measure, calling `shared` from a function that returns an optional type - // will always pass the check below and return nil if the instance is not initialized. - if let instance = (sharedInstances[__function] as? T?) ?? nil { + if let instance = (sharedInstances[__function] as? T) { return instance }