mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-08-20 17:38:02 -05:00
Use more std::span arguments
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
|
||||
#include <chrono>
|
||||
#include <numeric>
|
||||
#include <span>
|
||||
#include <string>
|
||||
|
||||
#include <picojson.h>
|
||||
@@ -23,14 +24,13 @@ NetPlayIndex::~NetPlayIndex()
|
||||
Remove();
|
||||
}
|
||||
|
||||
static std::optional<picojson::value> ParseResponse(const std::vector<u8>& response)
|
||||
static std::optional<picojson::value> ParseResponse(std::span<const u8> response)
|
||||
{
|
||||
const std::string response_string(reinterpret_cast<const char*>(response.data()),
|
||||
response.size());
|
||||
const char* data = reinterpret_cast<const char*>(response.data());
|
||||
|
||||
picojson::value json;
|
||||
|
||||
const auto error = picojson::parse(json, response_string);
|
||||
const auto error = picojson::parse(json, data, data + response.size());
|
||||
|
||||
if (!error.empty())
|
||||
return {};
|
||||
|
||||
Reference in New Issue
Block a user