summaryrefslogtreecommitdiff
path: root/src/filters.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2011-06-30 09:26:14 -0500
committerJohn Wiegley <johnw@newartisans.com>2011-06-30 09:26:14 -0500
commit96dc3dcf9e757ebe4361a5f675b3de8dcf3ec416 (patch)
treed5f4cc9b9e3d7523abf5cfc9ae3a26b94b0cdcfc /src/filters.cc
parent77e6694de5af86e63a65c21d4703af1a6741250f (diff)
downloadfork-ledger-96dc3dcf9e757ebe4361a5f675b3de8dcf3ec416.tar.gz
fork-ledger-96dc3dcf9e757ebe4361a5f675b3de8dcf3ec416.tar.bz2
fork-ledger-96dc3dcf9e757ebe4361a5f675b3de8dcf3ec416.zip
Simplified some code
Diffstat (limited to 'src/filters.cc')
-rw-r--r--src/filters.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/filters.cc b/src/filters.cc
index 89dc552e..2a040029 100644
--- a/src/filters.cc
+++ b/src/filters.cc
@@ -1397,13 +1397,12 @@ void inject_posts::operator()(post_t& post)
{
foreach (tags_list_pair& pair, tags_list) {
optional<value_t> tag_value = post.get_tag(pair.first, false);
+ // When checking if the transaction has the tag, only inject once
+ // per transaction.
if (! tag_value &&
- pair.second.second.find(post.xact) == pair.second.second.end()) {
- // When checking if the transaction has the tag, only inject once
- // per transaction.
+ pair.second.second.find(post.xact) == pair.second.second.end() &&
+ (tag_value = post.xact->get_tag(pair.first)))
pair.second.second.insert(post.xact);
- tag_value = post.xact->get_tag(pair.first);
- }
if (tag_value) {
xact_t& xact = temps.copy_xact(*post.xact);