Merge pull request #14500 from Sintendo/span2

Replace `const std::vector&` arguments with `std::span`
This commit is contained in:
Jordan Woyak authored and GitHub committed 2026-04-11 14:55:41 -05:00
commit 33f62b0f9f
79 files changed
+164 -146

No files matched your search

+4 -4
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 {};