Merge pull request #19683 from lorentey/inline-customization-points
[stdlib] Force-inline some Sequence/Collection customization points
diff --git a/stdlib/public/core/Collection.swift b/stdlib/public/core/Collection.swift
index f9dac4d..ef8c146 100644
--- a/stdlib/public/core/Collection.swift
+++ b/stdlib/public/core/Collection.swift
@@ -1267,6 +1267,7 @@
///
/// - Complexity: Hopefully less than O(`count`).
@inlinable
+ @inline(__always)
public // dispatching
func _customIndexOfEquatableElement(_: Element) -> Index?? {
return nil
@@ -1283,6 +1284,7 @@
///
/// - Complexity: Hopefully less than O(`count`).
@inlinable
+ @inline(__always)
public // dispatching
func _customLastIndexOfEquatableElement(_ element: Element) -> Index?? {
return nil
@@ -1802,6 +1804,7 @@
extension Collection {
@inlinable
+ @inline(__always)
public func _preprocessingPass<R>(
_ preprocess: () throws -> R
) rethrows -> R? {
diff --git a/stdlib/public/core/Dictionary.swift b/stdlib/public/core/Dictionary.swift
index 2a76d0f..0054651 100644
--- a/stdlib/public/core/Dictionary.swift
+++ b/stdlib/public/core/Dictionary.swift
@@ -1383,16 +1383,19 @@
}
@inlinable
+ @inline(__always)
public func _customContainsEquatableElement(_ element: Element) -> Bool? {
return _variant.contains(element)
}
@inlinable
+ @inline(__always)
public func _customIndexOfEquatableElement(_ element: Element) -> Index?? {
return Optional(_variant.index(forKey: element))
}
@inlinable
+ @inline(__always)
public func _customLastIndexOfEquatableElement(_ element: Element) -> Index?? {
// The first and last elements are the same because each element is unique.
return _customIndexOfEquatableElement(element)
diff --git a/stdlib/public/core/Sequence.swift b/stdlib/public/core/Sequence.swift
index 6cd5ff0..85d154b 100644
--- a/stdlib/public/core/Sequence.swift
+++ b/stdlib/public/core/Sequence.swift
@@ -905,6 +905,7 @@
}
@inlinable
+ @inline(__always)
public func _preprocessingPass<R>(
_ preprocess: () throws -> R
) rethrows -> R? {
@@ -912,6 +913,7 @@
}
@inlinable
+ @inline(__always)
public func _customContainsEquatableElement(
_ element: Iterator.Element
) -> Bool? {
diff --git a/stdlib/public/core/Set.swift b/stdlib/public/core/Set.swift
index 2dadaab..6541ba7 100644
--- a/stdlib/public/core/Set.swift
+++ b/stdlib/public/core/Set.swift
@@ -266,6 +266,7 @@
}
@inlinable
+ @inline(__always)
public func _customContainsEquatableElement(_ member: Element) -> Bool? {
return contains(member)
}
@@ -361,6 +362,7 @@
}
@inlinable
+ @inline(__always)
public func _customIndexOfEquatableElement(
_ member: Element
) -> Index?? {
@@ -368,6 +370,7 @@
}
@inlinable
+ @inline(__always)
public func _customLastIndexOfEquatableElement(
_ member: Element
) -> Index?? {