Skip to content

Commit

Permalink
Implement BBV custom contains function. (#2044)
Browse files Browse the repository at this point in the history
  • Loading branch information
SeJV authored Feb 9, 2022
1 parent d1814ea commit 154f1d3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Sources/NIOCore/ByteBuffer-views.swift
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,13 @@ public struct ByteBufferView: RandomAccessCollection {
return ptr.lastIndex(of: element).map { $0 + self._range.lowerBound }
})
}

@inlinable
public func _customContainsEquatableElement(_ element: Element) -> Bool? {
return .some(self.withUnsafeBytes { ptr -> Bool in
return ptr.contains(element)
})
}

@inlinable
public func _copyContents(
Expand Down

0 comments on commit 154f1d3

Please sign in to comment.