1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 12:07:45 +00:00

AK: Don't use east-constexpr in Span methods

This commit is contained in:
Timothy Flynn 2024-03-14 12:42:18 -04:00 committed by Andreas Kling
parent 0994aa91dc
commit faf4ba63c2

View file

@ -210,7 +210,7 @@ public:
return size(); return size();
} }
[[nodiscard]] bool constexpr contains_slow(T const& value) const [[nodiscard]] constexpr bool contains_slow(T const& value) const
{ {
for (size_t i = 0; i < size(); ++i) { for (size_t i = 0; i < size(); ++i) {
if (at(i) == value) if (at(i) == value)
@ -219,7 +219,7 @@ public:
return false; return false;
} }
[[nodiscard]] bool constexpr starts_with(ReadonlySpan<T> other) const [[nodiscard]] constexpr bool starts_with(ReadonlySpan<T> other) const
{ {
if (size() < other.size()) if (size() < other.size())
return false; return false;
@ -227,7 +227,7 @@ public:
return TypedTransfer<T>::compare(data(), other.data(), other.size()); return TypedTransfer<T>::compare(data(), other.data(), other.size());
} }
[[nodiscard]] size_t constexpr matching_prefix_length(ReadonlySpan<T> other) const [[nodiscard]] constexpr size_t matching_prefix_length(ReadonlySpan<T> other) const
{ {
auto maximum_length = min(size(), other.size()); auto maximum_length = min(size(), other.size());