mirror of
https://github.com/apple/swift-nio
synced 2026-11-26 04:57:49 +00:00
Motivation: Simplifies the code by putting the iterator in HTTPHeader's namespace. Additionally, removing the type erasure should result in more performant code as `AnyIterator` is an optimization barrier. The type erasure did not appear to be adding an abstraction benefit. Modifications: Nested (internal) type `HTTPHeaderIterator` as `HTTPHeader.Iterator` Explicit rather than inferred types for `Element` and `Iterator`. Eliminated `AnyIterator` wrapper from `makeIterator()` Added lower-priority version that still returns `AnyIterator` for source compatibility. Result: Unless caller was explicitly typing the iterator, should have no noticeable impact other than performance.