summaryrefslogtreecommitdiff
path: root/constraint.cc
diff options
context:
space:
mode:
Diffstat (limited to 'constraint.cc')
-rw-r--r--constraint.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/constraint.cc b/constraint.cc
index 1248c2b1..0af49502 100644
--- a/constraint.cc
+++ b/constraint.cc
@@ -1,9 +1,16 @@
#include "constraint.h"
+#include "expr.h"
#include <pcre.h>
namespace ledger {
+constraints_t::~constraints_t()
+{
+ if (predicate) delete predicate;
+ if (sort_order) delete sort_order;
+}
+
mask_t::mask_t(const std::string& pat) : exclude(false)
{
const char * p = pat.c_str();
@@ -183,14 +190,13 @@ bool constraints_t::operator ()(const entry_t * entry) const
bool constraints_t::operator ()(const item_t * item) const
{
- if (predicate && ! predicate->compute(begin(), end(), item))
+ if (predicate && ! predicate->compute(item, begin(), end()))
return false;
if (! matches_date_range(item->date))
return false;
- if (! payee_masks.empty() &&
- ! (matches(payee_masks, item->payee)))
+ if (! payee_masks.empty() && ! matches(payee_masks, item->payee))
return false;
#if 0