diff options
author | John Wiegley <johnw@newartisans.com> | 2004-07-30 23:42:59 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2004-07-30 23:42:59 -0400 |
commit | 493694f84869190340a035e524c78d6a6a71bf6c (patch) | |
tree | e87ab37f98b0fe2ec05ef3da92b67710cad25a87 /format.h | |
parent | 94e76ae87e883291d13320738fe165c7a2a2415b (diff) | |
download | fork-ledger-493694f84869190340a035e524c78d6a6a71bf6c.tar.gz fork-ledger-493694f84869190340a035e524c78d6a6a71bf6c.tar.bz2 fork-ledger-493694f84869190340a035e524c78d6a6a71bf6c.zip |
predicate are now used instead of constraints
Diffstat (limited to 'format.h')
-rw-r--r-- | format.h | 29 |
1 files changed, 2 insertions, 27 deletions
@@ -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 |