diff options
author | Andreas Kling <kling@serenityos.org> | 2020-12-19 15:56:15 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-12-19 18:29:13 +0100 |
commit | f82b0a78eff1d79472d084ca327b30051df58487 (patch) | |
tree | ff6693751f9a0d87973227bbfaedc7efd31c213a /AK/Span.h | |
parent | 8e20208dd6d561f0891fd424d8c396c28247cff9 (diff) | |
download | serenity-f82b0a78eff1d79472d084ca327b30051df58487.zip |
LibTLS+LibCrypto: More ByteBuffer -> Span conversion
Diffstat (limited to 'AK/Span.h')
-rw-r--r-- | AK/Span.h | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -156,6 +156,13 @@ public: return this->m_values + start; } + ALWAYS_INLINE constexpr void overwrite(size_t offset, const void* data, size_t data_size) + { + // make sure we're not told to write past the end + ASSERT(offset + data_size <= size()); + __builtin_memcpy(this->data() + offset, data, data_size); + } + ALWAYS_INLINE constexpr size_t copy_to(Span<typename RemoveConst<T>::Type> other) const { ASSERT(other.size() >= size()); |