Re-instate "stdlib: Add some inlining attributes to help the optimizer getting the right inlining decisions."

This re-instates commit 8b0e36779e
This commit is contained in:
Erik Eckstein
2016-03-29 15:47:53 -07:00
parent a95979bdd2
commit c0964a492d
5 changed files with 51 additions and 19 deletions

View File

@@ -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()