summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2019-03-15 16:31:07 -0700
committerJohn Wiegley <johnw@newartisans.com>2019-03-15 17:30:47 -0700
commita1f94a06cdd89a7a0675903c604bd5dd4cc25e77 (patch)
treea9a7014d9820dee808f775cfacb4bd5581dccf9d
parent1d8f88333fbf209a6af2160f91da4e62f8acc767 (diff)
downloadfork-ledger-a1f94a06cdd89a7a0675903c604bd5dd4cc25e77.tar.gz
fork-ledger-a1f94a06cdd89a7a0675903c604bd5dd4cc25e77.tar.bz2
fork-ledger-a1f94a06cdd89a7a0675903c604bd5dd4cc25e77.zip
Greatly simplify balance_t::operator==
-rw-r--r--src/balance.h9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/balance.h b/src/balance.h
index 4ad960df..bd373cb9 100644
--- a/src/balance.h
+++ b/src/balance.h
@@ -186,14 +186,7 @@ public:
* in time.
*/
bool operator==(const balance_t& bal) const {
- amounts_map::const_iterator i, j;
- for (i = amounts.begin(), j = bal.amounts.begin();
- i != amounts.end() && j != bal.amounts.end();
- i++, j++) {
- if (! (i->first == j->first && i->second == j->second))
- return false;
- }
- return i == amounts.end() && j == bal.amounts.end();
+ return amounts == bal.amounts;
}
bool operator==(const amount_t& amt) const {
if (amt.is_null())