1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 04:37:44 +00:00

Everywhere: Pass AK::StringView by value

This commit is contained in:
Andreas Kling 2021-11-11 00:55:02 +01:00
parent ad5d217e76
commit 8b1108e485
392 changed files with 978 additions and 978 deletions

View file

@ -294,7 +294,7 @@ void IODevice::set_fd(int fd)
did_update_fd(fd);
}
bool IODevice::write(const StringView& v)
bool IODevice::write(StringView v)
{
return write((const u8*)v.characters_without_null_termination(), v.length());
}

View file

@ -75,7 +75,7 @@ public:
String read_line(size_t max_size = 16384);
bool write(const u8*, int size);
bool write(const StringView&);
bool write(StringView);
bool truncate(off_t);

View file

@ -50,7 +50,7 @@ void MimeData::set_text(const String& text)
set_data("text/plain", text.to_byte_buffer());
}
String guess_mime_type_based_on_filename(const StringView& path)
String guess_mime_type_based_on_filename(StringView path)
{
if (path.ends_with(".pbm", CaseSensitivity::CaseInsensitive))
return "image/xportablebitmap";

View file

@ -47,7 +47,7 @@ private:
HashMap<String, ByteBuffer> m_data;
};
String guess_mime_type_based_on_filename(const StringView&);
String guess_mime_type_based_on_filename(StringView);
Optional<String> guess_mime_type_based_on_sniffed_bytes(const ReadonlyBytes&);