summaryrefslogtreecommitdiff
path: root/format.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2004-08-21 23:18:45 -0400
committerJohn Wiegley <johnw@newartisans.com>2004-08-21 23:18:45 -0400
commit6d5333b89618734e59853ba7da75b920ac40dae0 (patch)
tree3ddcc232a2c229a2ace5ca739ba7de3889fb6edc /format.cc
parent3ff84b7363575c63129e5b7a5b142896b76dcf06 (diff)
downloadfork-ledger-6d5333b89618734e59853ba7da75b920ac40dae0.tar.gz
fork-ledger-6d5333b89618734e59853ba7da75b920ac40dae0.tar.bz2
fork-ledger-6d5333b89618734e59853ba7da75b920ac40dae0.zip
use value_t instead of balance_pair_t; gains for 10% binary, 2% textual
Diffstat (limited to 'format.cc')
-rw-r--r--format.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/format.cc b/format.cc
index 4bbce62b..19c4f141 100644
--- a/format.cc
+++ b/format.cc
@@ -216,6 +216,11 @@ void format_t::format_elements(std::ostream& out,
(elem->max_width > 0 ?
elem->max_width : elem->min_width));
break;
+ case value_t::BALANCE_PAIR:
+ ((balance_pair_t *) value.data)->quantity.write(out, elem->min_width,
+ (elem->max_width > 0 ?
+ elem->max_width : elem->min_width));
+ break;
default:
assert(0);
break;
@@ -353,9 +358,9 @@ bool format_account::disp_subaccounts_p(const account_t * account,
{
bool display = false;
unsigned int counted = 0;
- bool computed = false;
bool matches = disp_pred(account);
- balance_t acct_total;
+ value_t acct_total;
+ bool computed = false;
to_show = NULL;
@@ -365,7 +370,7 @@ bool format_account::disp_subaccounts_p(const account_t * account,
if (! disp_pred((*i).second))
continue;
- balance_t result;
+ value_t result;
format_t::compute_total(result, details_t((*i).second));
if (! computed) {