diff options
| author | Jordan Woyak <jordan.woyak@gmail.com> | 2025-10-26 22:40:40 -0500 |
|---|---|---|
| committer | Jordan Woyak <jordan.woyak@gmail.com> | 2026-02-15 20:14:14 -0600 |
| commit | 083faa8b218d4ef7bdb1e9a4e609da0f790fe5c0 (patch) | |
| tree | 37ac1ec9cfea7fadbf3244d36ddb12beb50c737e | |
| parent | 2c62214875e4d409136229421c44aa8b88fbb635 (diff) | |
DiscIO: Make Volume::DecodeString take a std::span so it can work with std::array.
| -rw-r--r-- | Source/Core/DiscIO/Volume.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Source/Core/DiscIO/Volume.h b/Source/Core/DiscIO/Volume.h index 3d161811e4..32f8e8d71f 100644 --- a/Source/Core/DiscIO/Volume.h +++ b/Source/Core/DiscIO/Volume.h @@ -8,6 +8,7 @@ #include <map> #include <memory> #include <optional> +#include <span> #include <string> #include <vector> @@ -143,16 +144,15 @@ public: virtual std::array<u8, 20> GetSyncHash() const = 0; protected: - template <u32 N> - std::string DecodeString(const char (&data)[N]) const + std::string DecodeString(std::span<const char> data) const { // strnlen to trim NULLs - std::string string(data, strnlen(data, sizeof(data))); + std::string string(data.data(), strnlen(data.data(), data.size())); if (GetRegion() == Region::NTSC_J) return SHIFTJISToUTF8(string); - else - return CP1252ToUTF8(string); + + return CP1252ToUTF8(string); } void ReadAndAddToSyncHash(Common::SHA1::Context* context, u64 offset, u64 length, |
