Skip to content

Commit 5cd1fff

Browse files
committed
[cxx-interop] Make some overlay functions inlinable
(cherry picked from commit 10d74b1)
1 parent 174b204 commit 5cd1fff

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

stdlib/public/Cxx/CxxConvertibleToCollection.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ extension RangeReplaceableCollection {
5555
/// container when each element is copied in O(1). Note that this might not
5656
/// be true for certain C++ types, e.g. those with a custom copy
5757
/// constructor that performs additional logic.
58+
@inlinable
5859
public init<C: CxxConvertibleToCollection>(_ elements: C)
5960
where C.RawIterator.Pointee == Element {
6061

@@ -72,6 +73,7 @@ extension SetAlgebra {
7273
/// container when each element is copied in O(1). Note that this might not
7374
/// be true for certain C++ types, e.g. those with a custom copy
7475
/// constructor that performs additional logic.
76+
@inlinable
7577
public init<C: CxxConvertibleToCollection>(_ elements: C)
7678
where C.RawIterator.Pointee == Element {
7779

stdlib/public/Cxx/CxxSet.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ public protocol CxxSet<Element> {
1818
}
1919

2020
extension CxxSet {
21+
@inlinable
2122
public func contains(_ element: Element) -> Bool {
2223
return count(element) > 0
2324
}

0 commit comments

Comments
 (0)