Corrected a transient display order flaw

This was harmless, but affected the testability of results.
This commit is contained in:
John Wiegley 2011-03-28 01:53:15 -04:00
parent 9f4307accd
commit af94c94a6f

View file

@ -325,9 +325,18 @@ bool xact_base_t::finalize()
DEBUG("xact.finalize", "there was a null posting");
if (balance.is_balance()) {
bool first = true;
const balance_t& bal(balance.as_balance());
typedef std::map<string, amount_t> sorted_amounts_map;
sorted_amounts_map samp;
foreach (const balance_t::amounts_map::value_type& pair, bal.amounts) {
std::pair<sorted_amounts_map::iterator, bool> result =
samp.insert(sorted_amounts_map::value_type(pair.first->mapping_key(),
pair.second));
assert(result.second);
}
bool first = true;
foreach (sorted_amounts_map::value_type& pair, samp) {
if (first) {
null_post->amount = pair.second.negated();
null_post->add_flags(POST_CALCULATED);