Terminal: Convert Vector<OwnPtr> to NonnullOwnPtrVector.

This commit is contained in:
Andreas Kling 2019-07-24 09:36:58 +02:00
parent 1686c4906b
commit 31a2a6ca2d
Notes: sideshowbarker 2024-07-19 13:04:23 +09:00
2 changed files with 7 additions and 7 deletions

View file

@ -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;

View file

@ -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;