diff options
author | John Wiegley <johnw@newartisans.com> | 2019-03-15 17:24:46 -0700 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2019-03-15 17:29:58 -0700 |
commit | 501fbc08ae5493db77bb34f4c4fbe1f3a3bc14e3 (patch) | |
tree | 9bfbdc9b2eb0c652d415526881002640a505b4cb /src/balance.cc | |
parent | d8d3183405999a2ed4c43a8fada76298ad089777 (diff) | |
download | fork-ledger-501fbc08ae5493db77bb34f4c4fbe1f3a3bc14e3.tar.gz fork-ledger-501fbc08ae5493db77bb34f4c4fbe1f3a3bc14e3.tar.bz2 fork-ledger-501fbc08ae5493db77bb34f4c4fbe1f3a3bc14e3.zip |
Change compare_by_commodity to return an integer
Diffstat (limited to 'src/balance.cc')
-rw-r--r-- | src/balance.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/balance.cc b/src/balance.cc index 1ae9edb2..5f5e6fc9 100644 --- a/src/balance.cc +++ b/src/balance.cc @@ -244,8 +244,11 @@ void balance_t::sorted_amounts(amounts_array& sorted) const { foreach (const amounts_map::value_type& pair, amounts) sorted.push_back(&pair.second); - std::stable_sort(sorted.begin(), sorted.end(), - commodity_t::compare_by_commodity()); + std::stable_sort( + sorted.begin(), sorted.end(), + [](const amount_t * left, const amount_t * right) { + return commodity_t::compare_by_commodity()(left, right) < 0; + }); } void balance_t::map_sorted_amounts(function<void(const amount_t&)> fn) const |