summaryrefslogtreecommitdiff
path: root/AK
diff options
context:
space:
mode:
Diffstat (limited to 'AK')
-rw-r--r--AK/Span.h9
1 files changed, 6 insertions, 3 deletions
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<typename RemoveConst<T>::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<typename RemoveConst<T>::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)