mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 23:37:36 +00:00
Everywhere: Stop using NonnullOwnPtrVector
Same as NonnullRefPtrVector: weird semantics, questionable benefits.
This commit is contained in:
parent
689ca370d4
commit
359d6e7b0b
111 changed files with 517 additions and 503 deletions
|
@ -120,11 +120,11 @@ public:
|
|||
Line& line(size_t index)
|
||||
{
|
||||
if (m_use_alternate_screen_buffer) {
|
||||
return m_alternate_screen_buffer[index];
|
||||
return *m_alternate_screen_buffer[index];
|
||||
} else {
|
||||
if (index < m_history.size())
|
||||
return m_history[(m_history_start + index) % m_history.size()];
|
||||
return m_normal_screen_buffer[index - m_history.size()];
|
||||
return *m_history[(m_history_start + index) % m_history.size()];
|
||||
return *m_normal_screen_buffer[index - m_history.size()];
|
||||
}
|
||||
}
|
||||
Line const& line(size_t index) const
|
||||
|
@ -134,12 +134,12 @@ public:
|
|||
|
||||
Line& visible_line(size_t index)
|
||||
{
|
||||
return active_buffer()[index];
|
||||
return *active_buffer()[index];
|
||||
}
|
||||
|
||||
Line const& visible_line(size_t index) const
|
||||
{
|
||||
return active_buffer()[index];
|
||||
return *active_buffer()[index];
|
||||
}
|
||||
|
||||
size_t max_history_size() const { return m_max_history_lines; }
|
||||
|
@ -155,7 +155,7 @@ public:
|
|||
}
|
||||
|
||||
if (m_max_history_lines > value) {
|
||||
NonnullOwnPtrVector<Line> new_history;
|
||||
Vector<NonnullOwnPtr<Line>> new_history;
|
||||
new_history.ensure_capacity(value);
|
||||
auto existing_line_count = min(m_history.size(), value);
|
||||
for (size_t i = m_history.size() - existing_line_count; i < m_history.size(); ++i) {
|
||||
|
@ -381,7 +381,7 @@ protected:
|
|||
EscapeSequenceParser m_parser;
|
||||
#ifndef KERNEL
|
||||
size_t m_history_start = 0;
|
||||
NonnullOwnPtrVector<Line> m_history;
|
||||
Vector<NonnullOwnPtr<Line>> m_history;
|
||||
void add_line_to_history(NonnullOwnPtr<Line>&& line)
|
||||
{
|
||||
if (max_history_size() == 0)
|
||||
|
@ -397,14 +397,14 @@ protected:
|
|||
|
||||
return;
|
||||
}
|
||||
m_history.ptr_at(m_history_start) = move(line);
|
||||
m_history[m_history_start] = move(line);
|
||||
m_history_start = (m_history_start + 1) % m_history.size();
|
||||
}
|
||||
|
||||
NonnullOwnPtrVector<Line>& active_buffer() { return m_use_alternate_screen_buffer ? m_alternate_screen_buffer : m_normal_screen_buffer; };
|
||||
NonnullOwnPtrVector<Line> const& active_buffer() const { return m_use_alternate_screen_buffer ? m_alternate_screen_buffer : m_normal_screen_buffer; };
|
||||
NonnullOwnPtrVector<Line> m_normal_screen_buffer;
|
||||
NonnullOwnPtrVector<Line> m_alternate_screen_buffer;
|
||||
Vector<NonnullOwnPtr<Line>>& active_buffer() { return m_use_alternate_screen_buffer ? m_alternate_screen_buffer : m_normal_screen_buffer; };
|
||||
Vector<NonnullOwnPtr<Line>> const& active_buffer() const { return m_use_alternate_screen_buffer ? m_alternate_screen_buffer : m_normal_screen_buffer; };
|
||||
Vector<NonnullOwnPtr<Line>> m_normal_screen_buffer;
|
||||
Vector<NonnullOwnPtr<Line>> m_alternate_screen_buffer;
|
||||
#endif
|
||||
|
||||
bool m_use_alternate_screen_buffer { false };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue