mirror of
https://github.com/apple/swift-nio
synced 2026-11-25 04:47:49 +00:00
Motivation: During the `PR` apple/swift-nio#347 there was a discussion around which protocols this autoexpanding buffer should conform; the following 3 being the winners: 1. BidirectionalCollection 2. RandomAccessCollection 3. RangeReplaceableCollection Modifications: Added conformance to the 3 protocolos and provided implementaiton for 4 methods: 1. replaceSubrange(:with:) 2. index(before:) 3. removeSubrange(:) 4. remove(at:) 5. removeLast(:) Result: With the conformance of this 3 protocols and the implementation of this 5 functions we get dropLast(), dropLast(:), removeFirst(), removeLast() & popLast() for free.