diff options
author | hop311 <hop3114@gmail.com> | 2024-07-19 20:02:25 +0200 |
---|---|---|
committer | hop311 <hop3114@gmail.com> | 2024-07-19 20:02:25 +0200 |
commit | 03647d2249f72b6545628bb844685f87c4581062 (patch) | |
tree | 435dde45bb17dc12e74cc79bd5f25cc7a7ef8dca /src/openvic-simulation/history/Period.cpp | |
parent | a673f89bb2705826b1c646365eab1775727372b7 (diff) |
Cleanup: inheritance, const movable variables, code formattingformat-cleanup
Diffstat (limited to 'src/openvic-simulation/history/Period.cpp')
-rw-r--r-- | src/openvic-simulation/history/Period.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/openvic-simulation/history/Period.cpp b/src/openvic-simulation/history/Period.cpp index 2c6589c..b5a9c82 100644 --- a/src/openvic-simulation/history/Period.cpp +++ b/src/openvic-simulation/history/Period.cpp @@ -5,15 +5,15 @@ using namespace OpenVic; Period::Period( - const Date new_start_date, - const std::optional<Date> new_end_date + Date new_start_date, + std::optional<Date> new_end_date ) : start_date { new_start_date }, end_date { new_end_date } {} -bool Period::is_date_in_period(const Date date) const { +bool Period::is_date_in_period(Date date) const { return start_date <= date && (!end_date.has_value() || end_date.value() >= date); } -bool Period::try_set_end(const Date date) { +bool Period::try_set_end(Date date) { if (end_date.has_value()) { Logger::error("Period already has end date ", end_date.value()); return false; |