Skip to content

Use -[NSSet getObjects:] instead of -[NSSet getObjects:count:] to maintain compatibility with existing code passing NSArrays into this function #28829

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

Merged
merged 1 commit into from
Dec 19, 2019
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion stdlib/public/core/SetBridging.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ internal func _stdlib_NSSet_allObjects(_ object: AnyObject) -> _BridgingBuffer {
let nss = unsafeBitCast(object, to: _NSSet.self)
let count = nss.count
let storage = _BridgingBuffer(count)
nss.getObjects(storage.baseAddress, count: count)
nss.getObjects(storage.baseAddress)
return storage
}

Expand Down
4 changes: 4 additions & 0 deletions stdlib/public/core/ShadowProtocols.swift
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,10 @@ internal protocol _NSSet: _NSSetCore {
_ buffer: UnsafeMutablePointer<AnyObject>,
count: Int
)

@objc(getObjects:) func getObjects(
_ buffer: UnsafeMutablePointer<AnyObject>
)
}

/// A shadow for the API of NSNumber we will use in the core
Expand Down