diff --git a/AK/Span.h b/AK/Span.h index e6b0d74f61..a0084d6340 100644 --- a/AK/Span.h +++ b/AK/Span.h @@ -164,15 +164,18 @@ public: return this->m_values + start; } - ALWAYS_INLINE void copy_to(Span other) const + ALWAYS_INLINE size_t copy_to(Span::Type> other) const { ASSERT(other.size() >= size()); __builtin_memmove(other.data(), data(), sizeof(T) * size()); + return size(); } - ALWAYS_INLINE void copy_trimmed_to(Span other) const + ALWAYS_INLINE size_t copy_trimmed_to(Span::Type> other) const { - __builtin_memmove(other.data(), data(), sizeof(T) * min(size(), other.size())); + auto count = min(size(), other.size()); + __builtin_memmove(other.data(), data(), sizeof(T) * count); + return count; } ALWAYS_INLINE void fill(const T& value)