mirror of
https://github.com/apple/swift-nio
synced 2026-11-24 04:37:54 +00:00
Motivation: The compiler is better at optimising closures wrapped in nominal types than raw closures when used as generic parameters. CallbackList is used a lot and stores an optional closure as well as on optional array of closures. Wrapping these internally should save some allocations. Modifications: - Wrap the element stored in the `CallbackList`. Result: Fewer allocs --------- Co-authored-by: Cory Benfield <lukasa@apple.com>