Equip history_item_t with a default constructor

This commit is contained in:
ridiculousfish 2019-08-17 20:01:44 -07:00
parent 85f57d1d33
commit 0da87d3e5f
3 changed files with 4 additions and 3 deletions

View file

@ -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) {

View file

@ -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; }

View file

@ -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) {