Simplify std::copy with std::copy_n

+ a surprise `std::memcpy` in VolumeVerifier.cpp.
This commit is contained in:
mitaclaw
2024-09-28 15:37:09 -07:00
parent 2b22e6ffc9
commit 7c96762f5f
12 changed files with 16 additions and 19 deletions

View File

@ -1301,8 +1301,7 @@ void VolumeVerifier::Finish()
{
m_result.hashes.crc32 = std::vector<u8>(4);
const u32 crc32_be = Common::swap32(m_crc32_context);
const u8* crc32_be_ptr = reinterpret_cast<const u8*>(&crc32_be);
std::copy(crc32_be_ptr, crc32_be_ptr + 4, m_result.hashes.crc32.begin());
std::memcpy(m_result.hashes.crc32.data(), &crc32_be, 4);
}
if (m_hashes_to_calculate.md5)