mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-28 05:43:11 +00:00
Equip history_item_t with a default constructor
This commit is contained in:
parent
85f57d1d33
commit
0da87d3e5f
3 changed files with 4 additions and 3 deletions
|
@ -510,7 +510,7 @@ history_item_t history_impl_t::item_at_index(size_t idx) {
|
|||
}
|
||||
|
||||
// Index past the valid range, so return an empty history item.
|
||||
return history_item_t(wcstring(), 0);
|
||||
return history_item_t{};
|
||||
}
|
||||
|
||||
std::unordered_map<long, wcstring> history_impl_t::items_at_indexes(const std::vector<long> &idxs) {
|
||||
|
|
|
@ -82,7 +82,8 @@ class history_item_t {
|
|||
path_list_t required_paths;
|
||||
|
||||
public:
|
||||
explicit history_item_t(const wcstring &str, time_t when = 0, history_identifier_t ident = 0);
|
||||
explicit history_item_t(const wcstring &str = wcstring(), time_t when = 0,
|
||||
history_identifier_t ident = 0);
|
||||
|
||||
const wcstring &str() const { return contents; }
|
||||
|
||||
|
|
|
@ -157,7 +157,7 @@ history_item_t history_file_contents_t::decode_item(size_t offset) const {
|
|||
case history_type_fish_1_x:
|
||||
return decode_item_fish_1_x(base, len);
|
||||
}
|
||||
return history_item_t(L"");
|
||||
return history_item_t{};
|
||||
}
|
||||
|
||||
maybe_t<size_t> history_file_contents_t::offset_of_next_item(size_t *cursor, time_t cutoff) {
|
||||
|
|
Loading…
Reference in a new issue