summaryrefslogtreecommitdiff
path: root/src/filters.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2010-06-20 20:13:15 -0400
committerJohn Wiegley <johnw@newartisans.com>2010-06-20 20:29:56 -0400
commitc5714a81e39bf93a35020a31e6655c0eca5405f9 (patch)
tree4b6bd8b02ef293e7ea1d195e19afc322cc60e438 /src/filters.cc
parent3a5653e365b1572ee43fbfb8213edd1083de97cd (diff)
downloadfork-ledger-c5714a81e39bf93a35020a31e6655c0eca5405f9.tar.gz
fork-ledger-c5714a81e39bf93a35020a31e6655c0eca5405f9.tar.bz2
fork-ledger-c5714a81e39bf93a35020a31e6655c0eca5405f9.zip
Factored out some unused local variables
Diffstat (limited to 'src/filters.cc')
-rw-r--r--src/filters.cc14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/filters.cc b/src/filters.cc
index 4adf7203..d4fbae06 100644
--- a/src/filters.cc
+++ b/src/filters.cc
@@ -1308,19 +1308,18 @@ void forecast_posts::flush()
least = i;
}
- date_t& begin = *(*least).first.start;
#if !defined(NO_ASSERTS)
if ((*least).first.finish)
- assert(begin < *(*least).first.finish);
+ assert(*(*least).first.start < *(*least).first.finish);
#endif
// If the next date in the series for this periodic posting is more than 5
// years beyond the last valid post we generated, drop it from further
// consideration.
- optional<date_t> next((*least).first.next);
+ date_t& next(*(*least).first.next);
+ assert(next > *(*least).first.start);
- if (! next ||
- static_cast<std::size_t>((*next - last).days()) >
+ if (static_cast<std::size_t>((next - last).days()) >
static_cast<std::size_t>(365U) * forecast_years) {
DEBUG("filters.forecast",
"Forecast transaction exceeds " << forecast_years
@@ -1329,16 +1328,13 @@ void forecast_posts::flush()
continue;
}
- assert(*next > begin);
- begin = *next;
-
// `post' refers to the posting defined in the period transaction. We
// make a copy of it within a temporary transaction with the payee
// "Forecast transaction".
post_t& post = *(*least).second;
xact_t& xact = temps.create_xact();
xact.payee = _("Forecast transaction");
- xact._date = begin;
+ xact._date = next;
post_t& temp = temps.copy_post(post, xact);
// Submit the generated posting