I am comparing two byte arrays with memcmp (or rather a library function does that). The arrays can become relatively large, and they can actually be the same array in many cases.
Would it make sense to write something like this, or will memcmp already do that internally?
int memcmp_wrapper(const void* lhs, const void* rhs, std::size_t count) {
if (lhs == rhs)
return 0;
return std::memcmp(lhs, rhs, count);
}