Use more std::span arguments

This commit is contained in:
Sintendo
2026-02-01 09:20:46 +01:00
parent c05b231015
commit f6a67aa6e7
79 changed files with 164 additions and 146 deletions

View File

@@ -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 {};