Remove FIXME for string_view conversion.

This commit is contained in:
Stephen Anthony 2022-12-30 18:34:12 -03:30
parent 89fb53a510
commit 3458da8445
1 changed files with 3 additions and 5 deletions

View File

@ -30,12 +30,10 @@
Cartridge::Cartridge(const Settings& settings, string_view md5)
: mySettings{settings}
{
const auto to_uInt32 = [](string_view s, uInt32 pos) {
return static_cast<uInt32>(std::stoul(string{s.substr(pos, 8)}, nullptr, 16));
}; // FIXME: convert to string_view by replacing std::stoul
const uInt32 seed =
BSPF::stoi<16>(md5.substr(0, 8)) ^ BSPF::stoi<16>(md5.substr(8, 8)) ^
BSPF::stoi<16>(md5.substr(16, 8)) ^ BSPF::stoi<16>(md5.substr(24, 8));
const uInt32 seed = to_uInt32(md5, 0) ^ to_uInt32(md5, 8) ^
to_uInt32(md5, 16) ^ to_uInt32(md5, 24);
const Random rand(seed);
for(uInt32 i = 0; i < 256; ++i)
myRWPRandomValues[i] = rand.next();