Skip to content

Commit 6b1f6c0

Browse files
committed
[stdlib] _SetVariant.convertedToNative: New convenience function
1 parent e2415f7 commit 6b1f6c0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

stdlib/public/core/SetVariant.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,14 @@ extension Set._Variant {
108108
}
109109
#endif
110110

111+
@_alwaysEmitIntoClient
112+
internal var convertedToNative: _NativeSet<Element> {
113+
#if _runtime(_ObjC)
114+
guard isNative else { return _NativeSet<Element>(asCocoa) }
115+
#endif
116+
return asNative
117+
}
118+
111119
/// Reserves enough space for the specified number of elements to be stored
112120
/// without reallocating additional storage.
113121
internal mutating func reserveCapacity(_ capacity: Int) {

0 commit comments

Comments
 (0)