mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[string] Clean up String.UTF8View
Extract slow paths into non-inlinable functions so that fast-paths can be faster and we don't pay the large code bloat for the Unicode parsers. Some tests proactively extended to highlight UTF8View of multiple kinds of Strings.
This commit is contained in:
committed by
Michael Ilseman
parent
60b6789206
commit
00e214ec50
@@ -123,8 +123,15 @@ extension _StringGuts {
|
||||
@inlinable
|
||||
public // @testable
|
||||
var isASCII: Bool {
|
||||
// FIXME: Currently used to sometimes mean contiguous ASCII
|
||||
return _object.isContiguousASCII
|
||||
@inline(__always) get { return _object.isContiguousASCII }
|
||||
}
|
||||
|
||||
@inlinable
|
||||
internal
|
||||
var _isASCIIOrSmallASCII: Bool {
|
||||
@inline(__always) get {
|
||||
return isASCII || _isSmall && _smallUTF8String.isASCII
|
||||
}
|
||||
}
|
||||
|
||||
@inlinable
|
||||
|
||||
Reference in New Issue
Block a user