Codechange: replace memcpy with std::copy_n

This commit is contained in:
Rubidium
2025-05-08 19:42:57 +02:00
committed by rubidium42
parent a45f23686d
commit a48a5f0cc6
20 changed files with 41 additions and 39 deletions

View File

@@ -146,7 +146,7 @@ void RandomAccessFile::ReadBlock(void *ptr, size_t size)
{
if (this->buffer != this->buffer_end) {
size_t to_copy = std::min<size_t>(size, this->buffer_end - this->buffer);
memcpy(ptr, this->buffer, to_copy);
std::copy_n(this->buffer, to_copy, static_cast<uint8_t *>(ptr));
this->buffer += to_copy;
size -= to_copy;
if (size == 0) return;