Use wpi::span instead of wpi::ArrayRef across all libraries (#3414)

- Remove ArrayRef.h
- Add SpanExtras.h for a couple of convenience functions
This commit is contained in:
Peter Johnson
2021-06-06 19:51:14 -07:00
committed by GitHub
parent 2abbbd9e70
commit 64f5413253
167 changed files with 974 additions and 1433 deletions

View File

@@ -46,7 +46,7 @@ WebSocketServerHelper::WebSocketServerHelper(HttpParser& req) {
}
std::pair<bool, std::string_view> WebSocketServerHelper::MatchProtocol(
ArrayRef<std::string_view> protocols) {
span<const std::string_view> protocols) {
if (protocols.empty() && m_protocols.empty()) {
return {true, {}};
}
@@ -61,7 +61,7 @@ std::pair<bool, std::string_view> WebSocketServerHelper::MatchProtocol(
}
WebSocketServer::WebSocketServer(uv::Stream& stream,
ArrayRef<std::string_view> protocols,
span<const std::string_view> protocols,
ServerOptions options, const private_init&)
: m_stream{stream},
m_helper{m_req},
@@ -138,7 +138,7 @@ WebSocketServer::WebSocketServer(uv::Stream& stream,
}
std::shared_ptr<WebSocketServer> WebSocketServer::Create(
uv::Stream& stream, ArrayRef<std::string_view> protocols,
uv::Stream& stream, span<const std::string_view> protocols,
const ServerOptions& options) {
auto server = std::make_shared<WebSocketServer>(stream, protocols, options,
private_init{});