mirror of
https://github.com/apple/swift-nio
synced 2026-11-26 04:57:49 +00:00
Motivation: When converting an Array that holds existentials, it is necessary for Swift to allocate a new Array and copy the elements into it, so that it can fix up their existential boxes. We forced this to happen with taking a `[ChannelHandler]` to `[ChannelHandler & Sendable]`, without rewriting the other functions. The result of that was that the other functions needed to convert the channel handler types, causing extra allocations in this path. Modifications: Propagate the constraint down to the point where we iterate the Array. Result: Allocations reduced.