1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:07:34 +00:00

AK: Allow inlining more string functions

This commit is contained in:
Gunnar Beutner 2021-06-03 01:35:01 +02:00 committed by Andreas Kling
parent ed0068d04d
commit a4f320c76b
4 changed files with 17 additions and 24 deletions

View file

@ -15,11 +15,6 @@
namespace AK {
String::String(const StringView& view)
{
m_impl = StringImpl::create(view.characters_without_null_termination(), view.length());
}
bool String::operator==(const FlyString& fly_string) const
{
return *this == String(fly_string.impl());
@ -72,11 +67,6 @@ bool String::operator>(const String& other) const
return strcmp(characters(), other.characters()) > 0;
}
String String::empty()
{
return StringImpl::the_empty_stringimpl();
}
bool String::copy_characters_to_buffer(char* buffer, size_t buffer_size) const
{
// We must fit at least the NUL-terminator.
@ -456,11 +446,6 @@ bool String::operator==(const char* cstring) const
return !__builtin_strcmp(characters(), cstring);
}
StringView String::view() const
{
return { characters(), length() };
}
InputStream& operator>>(InputStream& stream, String& string)
{
StringBuilder builder;