mirror of
https://github.com/apple/swift-nio
synced 2026-11-24 04:37:54 +00:00
Motivation: Due to https://bugs.swift.org/browse/SR-10614, assigning an array containing a tuple type to a variable that expects an array containing a different-but-compatible tuple type will cause an allocation and copy of that array storage. In some cases this is necessary, but we were doing it in the HTTPHeaders constructors, which meant that the swift-nio-http2 code was hitting a hilariously over the top number of allocations. Modifications: - Change the internal storage type of HTTPHeaders to match the public constructor. Result: Fewer allocations when constructing HTTPHeaders