From 493694f84869190340a035e524c78d6a6a71bf6c Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Fri, 30 Jul 2004 23:42:59 -0400 Subject: predicate are now used instead of constraints --- format.h | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) (limited to 'format.h') diff --git a/format.h b/format.h index 33443508..96faab3c 100644 --- a/format.h +++ b/format.h @@ -63,37 +63,12 @@ struct format_t void format_elements(std::ostream& out, const item_t * item, const item_t * displayed_parent = NULL) const; -#if 1 static balance_t compute_value(const item_t * item) { - if (value_expr) - return value_expr->compute(item); - else - return balance_t(); + return value_expr ? value_expr->compute(item) : balance_t(); } - static balance_t compute_total(const item_t * item) { - if (total_expr) - return total_expr->compute(item); - else - return balance_t(); - } -#else - static balance_t compute_value(const item_t * item, - const constraints_t& constraints) { - if (value_expr) - return value_expr->compute(item, constraints.begin(), constraints.end()); - else - return balance_t(); - } - - static balance_t compute_total(const item_t * item, - const constraints_t& constraints) { - if (total_expr) - return total_expr->compute(item, constraints.begin(), constraints.end()); - else - return balance_t(); + return total_expr ? total_expr->compute(item) : balance_t(); } -#endif }; } // namespace ledger -- cgit v1.2.3