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
+2 -2
View File
@@ -281,7 +281,7 @@ void Md5::Append(const void *data, const size_t nbytes)
if (offset) {
size_t copy = (offset + nbytes > 64 ? 64 - offset : nbytes);
memcpy(this->buf + offset, p, copy);
std::copy_n(p, copy, this->buf + offset);
if (offset + copy < 64) return;
@@ -294,7 +294,7 @@ void Md5::Append(const void *data, const size_t nbytes)
for (; left >= 64; p += 64, left -= 64) this->Process(p);
/* Process a final partial block. */
if (left) memcpy(this->buf, p, left);
if (left) std::copy_n(p, left, this->buf);
}
void Md5::Finish(MD5Hash &digest)