From 0da87d3e5ff89c5bf2724717cf37700f0f281e7b Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Sat, 17 Aug 2019 20:01:44 -0700 Subject: [PATCH] Equip history_item_t with a default constructor --- src/history.cpp | 2 +- src/history.h | 3 ++- src/history_file.cpp | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/history.cpp b/src/history.cpp index 151aff6f0..77f1733e4 100644 --- a/src/history.cpp +++ b/src/history.cpp @@ -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 history_impl_t::items_at_indexes(const std::vector &idxs) { diff --git a/src/history.h b/src/history.h index ea199be46..42328e063 100644 --- a/src/history.h +++ b/src/history.h @@ -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; } diff --git a/src/history_file.cpp b/src/history_file.cpp index c21adc490..5fcba1abb 100644 --- a/src/history_file.cpp +++ b/src/history_file.cpp @@ -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 history_file_contents_t::offset_of_next_item(size_t *cursor, time_t cutoff) {