mirror of
https://github.com/apple/swift-atomics
synced 2026-11-27 04:44:21 +00:00
Merge pull request #17 from lorentey/support-5.2
Work around some compiler issues in Swift 5.2
This commit is contained in:
2 files changed
+5
-2
No files matched your search
@@ -51,7 +51,8 @@ extension Unmanaged {
|
||||
extension Unmanaged {
|
||||
fileprivate static func passRetained(_ instance: __owned Instance?) -> Self? {
|
||||
guard let instance = instance else { return nil }
|
||||
return .passRetained(instance)
|
||||
// Note: Swift 5.2 doesn't like this optional promotion without the explicit cast
|
||||
return .passRetained(instance) as Self
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -167,9 +167,11 @@ extension List {
|
||||
withExtendedLifetime(node) {}
|
||||
return result
|
||||
}
|
||||
}
|
||||
|
||||
extension List where Value: Hashable {
|
||||
@inline(never)
|
||||
func readUnique(expectedCount: Int = 0) -> Set<Value> where Value: Hashable {
|
||||
func readUnique(expectedCount: Int = 0) -> Set<Value> {
|
||||
var result: Set<Value> = []
|
||||
result.reserveCapacity(expectedCount)
|
||||
var node = head
|
||||
|
||||
Reference in new issue
Block a user