From 7c96762f5f4cf5d9952fbf4093a4173f0ced989a Mon Sep 17 00:00:00 2001 From: mitaclaw <140017135+mitaclaw@users.noreply.github.com> Date: Sat, 28 Sep 2024 15:37:09 -0700 Subject: Simplify `std::copy` with `std::copy_n` + a surprise `std::memcpy` in VolumeVerifier.cpp. --- Source/Core/DiscIO/VolumeVerifier.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'Source/Core/DiscIO/VolumeVerifier.cpp') diff --git a/Source/Core/DiscIO/VolumeVerifier.cpp b/Source/Core/DiscIO/VolumeVerifier.cpp index 5a4a9c6856..5cb9fa3e59 100644 --- a/Source/Core/DiscIO/VolumeVerifier.cpp +++ b/Source/Core/DiscIO/VolumeVerifier.cpp @@ -1301,8 +1301,7 @@ void VolumeVerifier::Finish() { m_result.hashes.crc32 = std::vector(4); const u32 crc32_be = Common::swap32(m_crc32_context); - const u8* crc32_be_ptr = reinterpret_cast(&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) -- cgit v1.2.3