Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused additional nil coalescing #631

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions ios/RIBs/Classes/DI/Component.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,7 @@ open class Component<DependencyType>: 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
}

Expand Down