summaryrefslogtreecommitdiff
path: root/format.h
diff options
context:
space:
mode:
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