mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-09 17:49:40 +00:00
LibLine: Use AK::Time instead of gettimeofday for history entries
This commit is contained in:
parent
80c259125c
commit
88fb2b0c9f
Notes:
github-actions[bot]
2025-02-13 02:15:00 +00:00
Author: https://github.com/ADKaster
Commit: 88fb2b0c9f
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3551
Reviewed-by: https://github.com/alimpfard ✅
Reviewed-by: https://github.com/shannonbooth
1 changed files with 2 additions and 3 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue