mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[String] Inlining, NFC fast paths, and more.
Add inlinability annotations to restore performance parity with 4.2 String. Take advantage of known NFC as a fast-path for comparison, and overhaul comparison dispatch. RRC improvements and optmizations.
This commit is contained in:
@@ -213,8 +213,7 @@ extension String.UnicodeScalarView : RangeReplaceableCollection {
|
||||
///
|
||||
/// - Parameter c: The character to append to the string.
|
||||
public mutating func append(_ c: Unicode.Scalar) {
|
||||
// TODO(UTF8 perf): This is a horribly slow means...
|
||||
self.append(contentsOf: [c])
|
||||
self._guts.append(String(c)._guts)
|
||||
}
|
||||
|
||||
/// Appends the Unicode scalar values in the given sequence to the view.
|
||||
|
||||
Reference in New Issue
Block a user