Changed interval_t::start to interval_t::set_start, to be more clear about how
it differs from interval_t::first.
This commit is contained in:
parent
ad02a482b6
commit
2bff7565c1
2 changed files with 6 additions and 5 deletions
|
|
@ -450,7 +450,7 @@ void interval_xacts::operator()(xact_t& xact)
|
||||||
if (interval) {
|
if (interval) {
|
||||||
if (! started) {
|
if (! started) {
|
||||||
if (! is_valid(interval.begin))
|
if (! is_valid(interval.begin))
|
||||||
interval.start(date);
|
interval.set_start(date);
|
||||||
start = interval.begin;
|
start = interval.begin;
|
||||||
started = true;
|
started = true;
|
||||||
}
|
}
|
||||||
|
|
@ -600,7 +600,7 @@ void budget_xacts::report_budget_items(const date_t& date)
|
||||||
foreach (pending_xacts_list::value_type& pair, pending_xacts) {
|
foreach (pending_xacts_list::value_type& pair, pending_xacts) {
|
||||||
date_t& begin = pair.first.begin;
|
date_t& begin = pair.first.begin;
|
||||||
if (! is_valid(begin)) {
|
if (! is_valid(begin)) {
|
||||||
pair.first.start(date);
|
pair.first.set_start(date);
|
||||||
begin = pair.first.begin;
|
begin = pair.first.begin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -667,7 +667,7 @@ void forecast_xacts::add_xact(const interval_t& period, xact_t& xact)
|
||||||
|
|
||||||
interval_t& i = pending_xacts.back().first;
|
interval_t& i = pending_xacts.back().first;
|
||||||
if (! is_valid(i.begin)) {
|
if (! is_valid(i.begin)) {
|
||||||
i.start(current_date);
|
i.set_start(current_date);
|
||||||
i.begin = i.increment(i.begin);
|
i.begin = i.increment(i.begin);
|
||||||
} else {
|
} else {
|
||||||
while (i.begin < current_date)
|
while (i.begin < current_date)
|
||||||
|
|
|
||||||
|
|
@ -140,9 +140,10 @@ struct interval_t
|
||||||
return years != 0 || months != 0 || days != 0;
|
return years != 0 || months != 0 || days != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void start(const date_t& moment) {
|
void set_start(const date_t& moment) {
|
||||||
begin = first(moment);
|
begin = moment;
|
||||||
}
|
}
|
||||||
|
|
||||||
date_t first(const optional<date_t>& moment = none) const;
|
date_t first(const optional<date_t>& moment = none) const;
|
||||||
date_t increment(const date_t&) const;
|
date_t increment(const date_t&) const;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue