diff options
author | Brian Gianforcaro <bgianf@serenityos.org> | 2022-01-03 03:27:29 -0800 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-01-05 14:04:18 +0100 |
commit | 538986c99172aa1c7759b25b9600613f1fbe1582 (patch) | |
tree | 2f3be3a901a33985b744f45f6924d4047b94bb06 /Userland/Libraries/LibVT/Line.cpp | |
parent | 6c66311ade7dcfdfed012129bc054e6c858119f1 (diff) | |
download | serenity-538986c99172aa1c7759b25b9600613f1fbe1582.zip |
Kernel+LibVT: Use MUST + try_prepend / try_append
In preparation for making Vector::append + Vector::prepend
unavailable during compilation of the Kernel.
This specific file is compiled into the Kernel as well as LibVT.
Diffstat (limited to 'Userland/Libraries/LibVT/Line.cpp')
-rw-r--r-- | Userland/Libraries/LibVT/Line.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibVT/Line.cpp b/Userland/Libraries/LibVT/Line.cpp index 6b84c8272b..f1c817b82f 100644 --- a/Userland/Libraries/LibVT/Line.cpp +++ b/Userland/Libraries/LibVT/Line.cpp @@ -74,7 +74,7 @@ void Line::push_cells_into_next_line(size_t new_length, Line* next_line, bool cu } } - next_line->m_cells.prepend(m_cells.span().slice_from_end(cells_to_push_into_next_line).data(), cells_to_push_into_next_line); + MUST(next_line->m_cells.try_prepend(m_cells.span().slice_from_end(cells_to_push_into_next_line).data(), cells_to_push_into_next_line)); m_cells.remove(m_cells.size() - cells_to_push_into_next_line, cells_to_push_into_next_line); if (m_terminated_at.has_value()) m_terminated_at = m_terminated_at.value() - cells_to_push_into_next_line; @@ -110,7 +110,7 @@ void Line::take_cells_from_next_line(size_t new_length, Line* next_line, bool cu cursor->column -= cells_to_grab_from_next_line; } } - m_cells.append(next_line->m_cells.data(), cells_to_grab_from_next_line); + MUST(m_cells.try_append(next_line->m_cells.data(), cells_to_grab_from_next_line)); next_line->m_cells.remove(0, cells_to_grab_from_next_line); } |