mirror of
https://github.com/apple/swift-http-types
synced 2026-11-26 04:57:48 +00:00
Eliminate hasPrefix usage for pseudo HTTP header names (#87)
UTF8 view is faster than hasPrefix rdar://144395951
This commit is contained in:
1 parent
99d1c41bac
commit
4bd2f8104f
3 files changed
+5
-5
No files matched your search
@@ -298,7 +298,7 @@ extension HTTPRequest.PseudoHeaderFields: Codable {
|
||||
}
|
||||
extendedConnectProtocol = field
|
||||
default:
|
||||
guard field.name.rawName.hasPrefix(":") else {
|
||||
guard field.name.rawName.utf8.first == UInt8(ascii: ":") else {
|
||||
throw DecodingError.dataCorruptedError(
|
||||
in: container,
|
||||
debugDescription: "\"\(field)\" is not a pseudo header field"
|
||||
|
||||
Reference in new issue
Block a user