mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
LibLine: Use AK::Time instead of gettimeofday for history entries
This commit is contained in:
committed by
Andrew Kaster
parent
80c259125c
commit
88fb2b0c9f
@@ -245,9 +245,8 @@ void Editor::add_to_history(ByteString const& line)
|
|||||||
return;
|
return;
|
||||||
if ((m_history.size() + 1) > m_history_capacity)
|
if ((m_history.size() + 1) > m_history_capacity)
|
||||||
m_history.take_first();
|
m_history.take_first();
|
||||||
struct timeval tv;
|
auto now = UnixDateTime::now();
|
||||||
gettimeofday(&tv, nullptr);
|
m_history.append({ line, now.seconds_since_epoch() });
|
||||||
m_history.append({ line, tv.tv_sec });
|
|
||||||
m_history_dirty = true;
|
m_history_dirty = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user