From a1f94a06cdd89a7a0675903c604bd5dd4cc25e77 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Fri, 15 Mar 2019 16:31:07 -0700 Subject: Greatly simplify balance_t::operator== --- src/balance.h | 9 +-------- 1 file changed, 1 insertion(+), 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()) -- cgit v1.2.3