AK: Remove unused Jakt methods

This commit is contained in:
Timothy Flynn 2025-05-10 16:10:18 -04:00 committed by Tim Flynn
commit e2b863ed3f
Notes: github-actions[bot] 2025-05-11 01:21:31 +00:00
2 changed files with 3 additions and 13 deletions

View file

@ -74,13 +74,6 @@ public:
return from_string_view(StringView { string_literal, N - 1 }); return from_string_view(StringView { string_literal, N - 1 });
} }
// Note: Don't call this from C++; it's here for Jakt interop (as the name suggests).
template<SameAs<StringView> T>
ALWAYS_INLINE static Error __jakt_from_string_literal(T string)
{
return from_string_view(string);
}
bool operator==(Error const& other) const bool operator==(Error const& other) const
{ {
return m_code == other.m_code && m_string_literal == other.m_string_literal && m_kind == other.m_kind; return m_code == other.m_code && m_string_literal == other.m_string_literal && m_kind == other.m_kind;

View file

@ -22,6 +22,7 @@ namespace AK {
class StringView { class StringView {
public: public:
ALWAYS_INLINE constexpr StringView() = default; ALWAYS_INLINE constexpr StringView() = default;
ALWAYS_INLINE constexpr StringView(char const* characters, size_t length) ALWAYS_INLINE constexpr StringView(char const* characters, size_t length)
: m_characters(characters) : m_characters(characters)
, m_length(length) , m_length(length)
@ -29,24 +30,20 @@ public:
if (!is_constant_evaluated()) if (!is_constant_evaluated())
VERIFY(!Checked<uintptr_t>::addition_would_overflow(reinterpret_cast<uintptr_t>(characters), length)); VERIFY(!Checked<uintptr_t>::addition_would_overflow(reinterpret_cast<uintptr_t>(characters), length));
} }
ALWAYS_INLINE StringView(unsigned char const* characters, size_t length) ALWAYS_INLINE StringView(unsigned char const* characters, size_t length)
: m_characters(reinterpret_cast<char const*>(characters)) : m_characters(reinterpret_cast<char const*>(characters))
, m_length(length) , m_length(length)
{ {
VERIFY(!Checked<uintptr_t>::addition_would_overflow(reinterpret_cast<uintptr_t>(characters), length)); VERIFY(!Checked<uintptr_t>::addition_would_overflow(reinterpret_cast<uintptr_t>(characters), length));
} }
ALWAYS_INLINE StringView(ReadonlyBytes bytes) ALWAYS_INLINE StringView(ReadonlyBytes bytes)
: m_characters(reinterpret_cast<char const*>(bytes.data())) : m_characters(reinterpret_cast<char const*>(bytes.data()))
, m_length(bytes.size()) , m_length(bytes.size())
{ {
} }
// Note: This is here for Jakt.
ALWAYS_INLINE static StringView from_string_literal(StringView string)
{
return string;
}
StringView(ByteBuffer const&); StringView(ByteBuffer const&);
StringView(String const&); StringView(String const&);
StringView(FlyString const&); StringView(FlyString const&);