LibLine: Use AK::Time instead of gettimeofday for history entries

This commit is contained in:
Andrew Kaster 2025-02-12 05:40:08 -07:00 committed by Andrew Kaster
parent 80c259125c
commit 88fb2b0c9f
Notes: github-actions[bot] 2025-02-13 02:15:00 +00:00

View file

@ -245,9 +245,8 @@ void Editor::add_to_history(ByteString const& line)
return;
if ((m_history.size() + 1) > m_history_capacity)
m_history.take_first();
struct timeval tv;
gettimeofday(&tv, nullptr);
m_history.append({ line, tv.tv_sec });
auto now = UnixDateTime::now();
m_history.append({ line, now.seconds_since_epoch() });
m_history_dirty = true;
}