summaryrefslogtreecommitdiff
path: root/src/filters.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-11-18 05:45:48 -0500
committerJohn Wiegley <johnw@newartisans.com>2009-11-18 05:45:48 -0500
commite4b3f0bb3a74b799f0f67d8b2f1efeedad5e2021 (patch)
tree605879730937c258e41090302bff105c6d0a96a1 /src/filters.cc
parent7fe369eb492f737f570d0ccf4aaf5db68f900279 (diff)
downloadfork-ledger-e4b3f0bb3a74b799f0f67d8b2f1efeedad5e2021.tar.gz
fork-ledger-e4b3f0bb3a74b799f0f67d8b2f1efeedad5e2021.tar.bz2
fork-ledger-e4b3f0bb3a74b799f0f67d8b2f1efeedad5e2021.zip
The new period parser is passing all tests
Diffstat (limited to 'src/filters.cc')
-rw-r--r--src/filters.cc14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/filters.cc b/src/filters.cc
index 5a92421b..47e7f66d 100644
--- a/src/filters.cc
+++ b/src/filters.cc
@@ -515,12 +515,14 @@ void subtotal_posts::report_subtotal(const char * spec_fmt,
optional<date_t> range_start = interval ? interval->start : none;
optional<date_t> range_finish = interval ? interval->inclusive_end() : none;
- foreach (post_t * post, component_posts) {
- date_t date = post->date();
- if (! range_start || date < *range_start)
- range_start = date;
- if (! range_finish || date > *range_finish)
- range_finish = date;
+ if (! range_start || ! range_finish) {
+ foreach (post_t * post, component_posts) {
+ date_t date = post->date();
+ if (! range_start || date < *range_start)
+ range_start = date;
+ if (! range_finish || date > *range_finish)
+ range_finish = date;
+ }
}
component_posts.clear();