mirror of
https://github.com/apple/swift-nio-extras.git
synced 2025-05-14 08:52:42 +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 {
|
||||
public init(_ oldHeaders: HTTPHeaders, splitCookie: Bool) {
|
||||
self.init()
|
||||
self.reserveCapacity(count)
|
||||
self.reserveCapacity(oldHeaders.count)
|
||||
var firstHost = true
|
||||
for field in oldHeaders {
|
||||
if firstHost && field.name.lowercased() == "host" {
|
||||
|
Loading…
x
Reference in New Issue
Block a user