mirror of
https://github.com/apple/swift-nio-extras.git
synced 2025-05-15 01:18:58 +08:00
Use oldHeaders.count
when reserving capacity in HTTPFields (#223)
This commit is contained in:
parent
efd416ee15
commit
ef36e67dbb
@ -136,7 +136,7 @@ extension HTTPHeaders {
|
|||||||
extension HTTPFields {
|
extension HTTPFields {
|
||||||
public init(_ oldHeaders: HTTPHeaders, splitCookie: Bool) {
|
public init(_ oldHeaders: HTTPHeaders, splitCookie: Bool) {
|
||||||
self.init()
|
self.init()
|
||||||
self.reserveCapacity(count)
|
self.reserveCapacity(oldHeaders.count)
|
||||||
var firstHost = true
|
var firstHost = true
|
||||||
for field in oldHeaders {
|
for field in oldHeaders {
|
||||||
if firstHost && field.name.lowercased() == "host" {
|
if firstHost && field.name.lowercased() == "host" {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user