From 538986c99172aa1c7759b25b9600613f1fbe1582 Mon Sep 17 00:00:00 2001 From: Brian Gianforcaro Date: Mon, 3 Jan 2022 03:27:29 -0800 Subject: 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. --- Userland/Libraries/LibVT/Line.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Userland/Libraries/LibVT/Line.cpp') 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); } -- cgit v1.2.3