Skip to content

Commit ceb48be

Browse files
authored
Merge pull request #65139 from apple/egorzhdan/cxx-overlay-inlinable
[cxx-interop] Make some overlay functions inlinable
2 parents 828bfec + 10d74b1 commit ceb48be

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
@@ -45,6 +45,7 @@ extension RangeReplaceableCollection {
4545
/// container when each element is copied in O(1). Note that this might not
4646
/// be true for certain C++ types, e.g. those with a custom copy
4747
/// constructor that performs additional logic.
48+
@inlinable
4849
public init<C: CxxConvertibleToCollection>(_ elements: C)
4950
where C.RawIterator.Pointee == Element {
5051

@@ -62,6 +63,7 @@ extension SetAlgebra {
6263
/// container when each element is copied in O(1). Note that this might not
6364
/// be true for certain C++ types, e.g. those with a custom copy
6465
/// constructor that performs additional logic.
66+
@inlinable
6567
public init<C: CxxConvertibleToCollection>(_ elements: C)
6668
where C.RawIterator.Pointee == Element {
6769

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)