summaryrefslogtreecommitdiff
path: root/src/filters.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2010-03-17 06:22:43 -0400
committerJohn Wiegley <johnw@newartisans.com>2010-03-17 06:22:43 -0400
commit7ca8149ec5c7fa88d98df83e6260210372223036 (patch)
tree4c5741d682e89b1ea4e567c32a78d32ba17737db /src/filters.cc
parent3bb4cb6b6055f180112f357cf23463a1b8c186c5 (diff)
parent8dd362b57cf2b49c5268e72898ae873522d8756f (diff)
downloadfork-ledger-7ca8149ec5c7fa88d98df83e6260210372223036.tar.gz
fork-ledger-7ca8149ec5c7fa88d98df83e6260210372223036.tar.bz2
fork-ledger-7ca8149ec5c7fa88d98df83e6260210372223036.zip
Merge branch 'next'
Diffstat (limited to 'src/filters.cc')
-rw-r--r--src/filters.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/filters.cc b/src/filters.cc
index 2926eb08..0c45d356 100644
--- a/src/filters.cc
+++ b/src/filters.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2009, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2010, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -107,6 +107,9 @@ void truncate_xacts::flush()
void truncate_xacts::operator()(post_t& post)
{
+ if (completed)
+ return;
+
if (last_xact != post.xact) {
if (last_xact)
xacts_seen++;
@@ -114,8 +117,11 @@ void truncate_xacts::operator()(post_t& post)
}
if (tail_count == 0 && head_count > 0 &&
- static_cast<int>(xacts_seen) >= head_count)
+ static_cast<int>(xacts_seen) >= head_count) {
+ flush();
+ completed = true;
return;
+ }
posts.push_back(&post);
}