summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2004-09-06 05:43:56 -0400
committerJohn Wiegley <johnw@newartisans.com>2004-09-06 05:43:56 -0400
commit93d73f828ce0425cb806b669a8075bd4b9e74340 (patch)
tree84b7fbcf102055630cbe2c891856dcd05de9598b
parentfcaaa372019b525980e40b148a1d542ab3acced9 (diff)
downloadfork-ledger-93d73f828ce0425cb806b669a8075bd4b9e74340.tar.gz
fork-ledger-93d73f828ce0425cb806b669a8075bd4b9e74340.tar.bz2
fork-ledger-93d73f828ce0425cb806b669a8075bd4b9e74340.zip
changed constructors to downgrade BALANCE and BALANCE_PAIR types when possible
-rw-r--r--value.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/value.h b/value.h
index 34af0f73..39a258b5 100644
--- a/value.h
+++ b/value.h
@@ -46,8 +46,9 @@ class value_t
*((unsigned int *) data) = value;
type = INTEGER;
}
- value_t(const amount_t& value) : type(INTEGER) {
- *this = value;
+ value_t(const amount_t& value) {
+ new((amount_t *)data) amount_t(value);
+ type = AMOUNT;
}
value_t(const balance_t& value) : type(INTEGER) {
*this = value;