diff options
author | John Wiegley <johnw@newartisans.com> | 2009-11-18 05:45:48 -0500 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-11-18 05:45:48 -0500 |
commit | e4b3f0bb3a74b799f0f67d8b2f1efeedad5e2021 (patch) | |
tree | 605879730937c258e41090302bff105c6d0a96a1 /src/filters.cc | |
parent | 7fe369eb492f737f570d0ccf4aaf5db68f900279 (diff) | |
download | fork-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.cc | 14 |
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(); |