mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-08-20 09:24:59 -05:00
Use more std::span arguments
This commit is contained in:
@@ -462,7 +462,7 @@ DHCPBody::DHCPBody(u32 transaction, const MACAddress& client_address, u32 new_ip
|
||||
|
||||
DHCPPacket::DHCPPacket() = default;
|
||||
|
||||
DHCPPacket::DHCPPacket(const std::vector<u8>& data)
|
||||
DHCPPacket::DHCPPacket(std::span<const u8> data)
|
||||
{
|
||||
if (data.size() < DHCPBody::SIZE)
|
||||
return;
|
||||
@@ -489,7 +489,7 @@ DHCPPacket::DHCPPacket(const std::vector<u8>& data)
|
||||
}
|
||||
}
|
||||
|
||||
void DHCPPacket::AddOption(u8 fnc, const std::vector<u8>& params)
|
||||
void DHCPPacket::AddOption(u8 fnc, std::span<const u8> params)
|
||||
{
|
||||
if (params.size() > 255)
|
||||
return;
|
||||
@@ -507,7 +507,7 @@ std::vector<u8> DHCPPacket::Build() const
|
||||
{
|
||||
result.insert(result.end(), opt.begin(), opt.end());
|
||||
}
|
||||
const std::vector<u8> no_option = {255, 0, 0, 0};
|
||||
constexpr auto no_option = std::to_array<u8>({255, 0, 0, 0});
|
||||
result.insert(result.end(), no_option.begin(), no_option.end());
|
||||
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user