mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 13:49:16 +00:00
LibLine: Use StringView::find() to find '::' in history entries
Fixes an issue mentioned in #4926.
This commit is contained in:
parent
4fe27ec2a7
commit
72be904259
Notes:
sideshowbarker
2024-07-18 23:52:56 +09:00
Author: https://github.com/alimpfard
Commit: 72be904259
Pull-request: https://github.com/SerenityOS/serenity/pull/4929
Issue: https://github.com/SerenityOS/serenity/issues/4926
1 changed files with 1 additions and 1 deletions
|
@ -292,7 +292,7 @@ bool Editor::save_history(const String& path)
|
|||
merge(
|
||||
file->line_begin(), file->line_end(), m_history.begin(), m_history.end(), final_history,
|
||||
[](StringView str) {
|
||||
auto it = str.find_first_of("::").value_or(0);
|
||||
auto it = str.find("::").value_or(0);
|
||||
auto time = str.substring_view(0, it).to_uint<time_t>().value_or(0);
|
||||
auto string = str.substring_view(it == 0 ? it : it + 2);
|
||||
return HistoryEntry { string, time };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue