diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-07-24 09:36:58 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-07-24 09:36:58 +0200 |
commit | 31a2a6ca2d79183d4961665dd915bbfca84f7c2f (patch) | |
tree | d19049262607d98fc9c60d70364eca011d40a80e /Applications | |
parent | 1686c4906b765810fcc44e36d3b4121b86708e28 (diff) | |
download | serenity-31a2a6ca2d79183d4961665dd915bbfca84f7c2f.zip |
Terminal: Convert Vector<OwnPtr> to NonnullOwnPtrVector.
Diffstat (limited to 'Applications')
-rw-r--r-- | Applications/Terminal/Terminal.cpp | 4 | ||||
-rw-r--r-- | Applications/Terminal/Terminal.h | 10 |
2 files changed, 7 insertions, 7 deletions
diff --git a/Applications/Terminal/Terminal.cpp b/Applications/Terminal/Terminal.cpp index bbd445f47c..41bb8b980f 100644 --- a/Applications/Terminal/Terminal.cpp +++ b/Applications/Terminal/Terminal.cpp @@ -930,11 +930,11 @@ void Terminal::set_size(u16 columns, u16 rows) while (m_lines.size() < rows) m_lines.append(make<Line>(columns)); } else { - m_lines.resize(rows); + m_lines.shrink(rows); } for (int i = 0; i < rows; ++i) - m_lines[i]->set_length(columns); + m_lines[i].set_length(columns); m_columns = columns; m_rows = rows; diff --git a/Applications/Terminal/Terminal.h b/Applications/Terminal/Terminal.h index 69e94a3c1c..efb5adda8e 100644 --- a/Applications/Terminal/Terminal.h +++ b/Applications/Terminal/Terminal.h @@ -1,14 +1,14 @@ #pragma once #include <AK/AKString.h> +#include <AK/NonnullOwnPtrVector.h> #include <AK/Types.h> -#include <AK/Vector.h> #include <LibCore/CConfigFile.h> #include <LibCore/CNotifier.h> #include <LibCore/CTimer.h> -#include <LibGUI/GFrame.h> #include <LibDraw/GraphicsBitmap.h> #include <LibDraw/Rect.h> +#include <LibGUI/GFrame.h> class Font; @@ -193,15 +193,15 @@ private: Line& line(size_t index) { ASSERT(index < m_rows); - return *m_lines[index]; + return m_lines[index]; } const Line& line(size_t index) const { ASSERT(index < m_rows); - return *m_lines[index]; + return m_lines[index]; } - Vector<OwnPtr<Line>> m_lines; + NonnullOwnPtrVector<Line> m_lines; BufferPosition m_selection_start; BufferPosition m_selection_end; |