summaryrefslogtreecommitdiff
path: root/valexpr.h
diff options
context:
space:
mode:
Diffstat (limited to 'valexpr.h')
-rw-r--r--valexpr.h25
1 files changed, 7 insertions, 18 deletions
diff --git a/valexpr.h b/valexpr.h
index f841cf95..91de7ed7 100644
--- a/valexpr.h
+++ b/valexpr.h
@@ -29,23 +29,12 @@ struct details_t
const transaction_t * xact;
const account_t * account;
- details_t(const entry_t * _entry)
- : entry(_entry), xact(NULL), account(NULL) {
- DEBUG_PRINT("ledger.memory.ctors", "ctor details_t");
- }
- details_t(const transaction_t * _xact)
- : entry(_xact->entry), xact(_xact), account(_xact->account) {
- DEBUG_PRINT("ledger.memory.ctors", "ctor details_t");
- }
- details_t(const account_t * _account)
- : entry(NULL), xact(NULL), account(_account) {
- DEBUG_PRINT("ledger.memory.ctors", "ctor details_t");
- }
-#ifdef DEBUG_ENABLED
- ~details_t() {
- DEBUG_PRINT("ledger.memory.dtors", "dtor details_t");
- }
-#endif
+ details_t(const entry_t& _entry)
+ : entry(&_entry), xact(NULL), account(NULL) {}
+ details_t(const transaction_t& _xact)
+ : entry(_xact.entry), xact(&_xact), account(_xact.account) {}
+ details_t(const account_t& _account)
+ : entry(NULL), xact(NULL), account(&_account) {}
};
struct value_expr_t
@@ -190,7 +179,7 @@ class item_predicate
delete predicate;
}
- bool operator()(const T * item) const {
+ bool operator()(const T& item) const {
if (predicate) {
value_t result;
predicate->compute(result, details_t(item));