diff options
author | John Wiegley <johnw@newartisans.com> | 2010-06-02 01:55:55 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2010-06-02 01:55:55 -0400 |
commit | cda19829bd1100d6563b48ddb121f2afc1c55d95 (patch) | |
tree | 5b6ab0d1eb7ec1b0b3eccf817678d0aa9a3feb47 /src/balance.h | |
parent | 017492ef5e80003073c5d053252d4a68a44260ae (diff) | |
parent | fb7cafa8965c89bbd66b09f827bd5989a87c983b (diff) | |
download | fork-ledger-cda19829bd1100d6563b48ddb121f2afc1c55d95.tar.gz fork-ledger-cda19829bd1100d6563b48ddb121f2afc1c55d95.tar.bz2 fork-ledger-cda19829bd1100d6563b48ddb121f2afc1c55d95.zip |
Merge branch 'next'
Diffstat (limited to 'src/balance.h')
-rw-r--r-- | src/balance.h | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/src/balance.h b/src/balance.h index f8455d49..5c00c55a 100644 --- a/src/balance.h +++ b/src/balance.h @@ -321,10 +321,8 @@ public: return temp; } void in_place_round() { - balance_t temp; - foreach (const amounts_map::value_type& pair, amounts) - temp += pair.second.rounded(); - *this = temp; + foreach (amounts_map::value_type& pair, amounts) + pair.second.in_place_round(); } balance_t truncated() const { @@ -333,10 +331,8 @@ public: return temp; } void in_place_truncate() { - balance_t temp; - foreach (const amounts_map::value_type& pair, amounts) - temp += pair.second.truncated(); - *this = temp; + foreach (amounts_map::value_type& pair, amounts) + pair.second.in_place_truncate(); } balance_t floored() const { @@ -345,10 +341,8 @@ public: return temp; } void in_place_floor() { - balance_t temp; - foreach (const amounts_map::value_type& pair, amounts) - temp += pair.second.floored(); - *this = temp; + foreach (amounts_map::value_type& pair, amounts) + pair.second.in_place_floor(); } balance_t unrounded() const { @@ -357,10 +351,8 @@ public: return temp; } void in_place_unround() { - balance_t temp; - foreach (const amounts_map::value_type& pair, amounts) - temp += pair.second.unrounded(); - *this = temp; + foreach (amounts_map::value_type& pair, amounts) + pair.second.in_place_unround(); } balance_t reduced() const { |