AK: Make Span trivially copy-constructible
There is no need to have a user-defined copy constructor that simply calls the base class's copy constructor. By having the compiler generate it for us, Span is made trivially copyable, so it can be passed in registers.
This commit is contained in:
parent
c524f58290
commit
9869b598d5
Notes:
sideshowbarker
2024-07-18 02:15:17 +09:00
Author: https://github.com/BertalanD Commit: https://github.com/SerenityOS/serenity/commit/9869b598d50 Pull-request: https://github.com/SerenityOS/serenity/pull/9378 Reviewed-by: https://github.com/ADKaster ✅ Reviewed-by: https://github.com/itamar8910 Reviewed-by: https://github.com/linusg ✅ Reviewed-by: https://github.com/nico Reviewed-by: https://github.com/timschumi
1 changed files with 0 additions and 12 deletions
12
AK/Span.h
12
AK/Span.h
|
@ -94,11 +94,6 @@ public:
|
|||
|
||||
constexpr Span() = default;
|
||||
|
||||
ALWAYS_INLINE constexpr Span(Span const& other)
|
||||
: Span(other.m_values, other.m_size)
|
||||
{
|
||||
}
|
||||
|
||||
[[nodiscard]] ALWAYS_INLINE constexpr T const* data() const { return this->m_values; }
|
||||
[[nodiscard]] ALWAYS_INLINE constexpr T* data() { return this->m_values; }
|
||||
|
||||
|
@ -211,13 +206,6 @@ public:
|
|||
return at(index);
|
||||
}
|
||||
|
||||
ALWAYS_INLINE constexpr Span& operator=(Span<T> const& other)
|
||||
{
|
||||
this->m_size = other.m_size;
|
||||
this->m_values = other.m_values;
|
||||
return *this;
|
||||
}
|
||||
|
||||
constexpr bool operator==(Span const& other) const
|
||||
{
|
||||
if (size() != other.size())
|
||||
|
|
Loading…
Add table
Reference in a new issue