summaryrefslogtreecommitdiff
path: root/src/amount.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2010-06-03 05:47:12 -0400
committerJohn Wiegley <johnw@newartisans.com>2010-06-03 05:47:12 -0400
commit0f1afdb3a7387e834c62b4ecc0a993bdde62d8f8 (patch)
tree65cc21cae598b8987af15ee5d56d60415af31f6f /src/amount.h
parent3a0f096cb64f581f0d8513c8b67ca41659982afa (diff)
downloadfork-ledger-0f1afdb3a7387e834c62b4ecc0a993bdde62d8f8.tar.gz
fork-ledger-0f1afdb3a7387e834c62b4ecc0a993bdde62d8f8.tar.bz2
fork-ledger-0f1afdb3a7387e834c62b4ecc0a993bdde62d8f8.zip
Minor optimization of amount_t::operator*
Diffstat (limited to 'src/amount.h')
-rw-r--r--src/amount.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/amount.h b/src/amount.h
index ae0e5a69..1ac4b37e 100644
--- a/src/amount.h
+++ b/src/amount.h
@@ -275,7 +275,10 @@ public:
amount_t& operator+=(const amount_t& amt);
amount_t& operator-=(const amount_t& amt);
- amount_t& operator*=(const amount_t& amt);
+ amount_t& operator*=(const amount_t& amt) {
+ return multiply(amt);
+ }
+ amount_t& multiply(const amount_t& amt, bool ignore_commodity = false);
/** Divide two amounts while extending the precision to preserve the
accuracy of the result. For example, if \c 10 is divided by \c 3,