summaryrefslogtreecommitdiff
path: root/format.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2004-07-30 23:42:59 -0400
committerJohn Wiegley <johnw@newartisans.com>2004-07-30 23:42:59 -0400
commit493694f84869190340a035e524c78d6a6a71bf6c (patch)
treee87ab37f98b0fe2ec05ef3da92b67710cad25a87 /format.h
parent94e76ae87e883291d13320738fe165c7a2a2415b (diff)
downloadfork-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.h29
1 files changed, 2 insertions, 27 deletions
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