AK: remove unused and uninteresting return value

The return value is always be 'count', even in the case of 0.

Note that the return value of TypedTransfer::copy() is likewise uninteresting,
but apparently it is beig used. Hence this patch does not touch it.
This commit is contained in:
Ben Wiederhake 2021-02-07 12:00:56 +01:00 committed by Andreas Kling
parent 71219b8a1d
commit 667b417d9f
Notes: sideshowbarker 2024-07-18 22:31:08 +09:00

View file

@ -33,14 +33,14 @@ namespace AK {
template<typename T>
class TypedTransfer {
public:
static size_t move(T* destination, T* source, size_t count)
static void move(T* destination, T* source, size_t count)
{
if (!count)
return 0;
return;
if constexpr (Traits<T>::is_trivial()) {
__builtin_memmove(destination, source, count * sizeof(T));
return count;
return;
}
for (size_t i = 0; i < count; ++i) {
@ -50,7 +50,7 @@ public:
new (&destination[count - i - 1]) T(AK::move(source[count - i - 1]));
}
return count;
return;
}
static size_t copy(T* destination, const T* source, size_t count)