1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:48:11 +00:00

Take StringView in more places

We should work towards a pattern where we take StringView as function
arguments, and store String as member, to push the String construction
to the last possible moment.
This commit is contained in:
Robin Burchell 2019-06-02 12:26:28 +02:00 committed by Andreas Kling
parent b55b6cd7fc
commit 7bce096afd
14 changed files with 28 additions and 36 deletions

View file

@ -108,7 +108,7 @@ void DirectoryView::set_view_mode(ViewMode mode)
ASSERT_NOT_REACHED();
}
void DirectoryView::add_path_to_history(const String& path)
void DirectoryView::add_path_to_history(const StringView& path)
{
if (m_path_history_position < m_path_history.size())
m_path_history.resize(m_path_history_position + 1);
@ -117,13 +117,13 @@ void DirectoryView::add_path_to_history(const String& path)
m_path_history_position = m_path_history.size() - 1;
}
void DirectoryView::open(const String& path)
void DirectoryView::open(const StringView& path)
{
add_path_to_history(path);
model().open(path);
}
void DirectoryView::set_status_message(const String& message)
void DirectoryView::set_status_message(const StringView& message)
{
if (on_status_message)
on_status_message(message);