diff options
author | Hop311 <Hop3114@gmail.com> | 2024-07-19 21:35:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-19 21:35:31 +0200 |
commit | d1f3a96b72dd06b5f97dd4643e5f016a02b42ea6 (patch) | |
tree | 38015e5729afbb98cf520e2cf26d8a4623d32f2f /src/openvic-simulation/history/Period.cpp | |
parent | e0518bee9b4c164f40716a8033b5e207c2060c0b (diff) | |
parent | 03647d2249f72b6545628bb844685f87c4581062 (diff) |
Merge pull request #176 from OpenVicProject/format-cleanup
Cleanup: inheritance, const movable variables, code formatting
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; |