mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
stdlib: Add some inlining attributes to help the optimizer getting the right inlining decisions.
This is more or less a workaround for some optimizations (mainly ARC opt) to avoid performance degradation with the upcoming inliner changes In some situations it makes a big difference for ARC opt if a function is inlined or not, althought this shouldn't be the case.
This commit is contained in:
@@ -41,6 +41,7 @@ extension String {
|
||||
self.idx = pos
|
||||
self.core = core
|
||||
}
|
||||
@inline(__always)
|
||||
mutating func next() -> UTF16.CodeUnit? {
|
||||
if idx == core.endIndex {
|
||||
return nil
|
||||
@@ -61,6 +62,7 @@ extension String {
|
||||
///
|
||||
/// - Precondition: The next value is representable.
|
||||
@warn_unused_result
|
||||
@inline(__always)
|
||||
public func successor() -> Index {
|
||||
var scratch = _ScratchIterator(_core, _position)
|
||||
var decoder = UTF16()
|
||||
|
||||
Reference in New Issue
Block a user