diff options
author | John Wiegley <johnw@newartisans.com> | 2010-06-05 01:57:16 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2010-06-05 02:18:01 -0400 |
commit | 653d2bd99a04f422c3755f42d6091f2b8817b26f (patch) | |
tree | 2d7c94469b561711339ac296142ffff2e72c560c /src/commodity.cc | |
parent | 83c115d78afec45e1815bae7ec30b8e92309e679 (diff) | |
download | fork-ledger-653d2bd99a04f422c3755f42d6091f2b8817b26f.tar.gz fork-ledger-653d2bd99a04f422c3755f42d6091f2b8817b26f.tar.bz2 fork-ledger-653d2bd99a04f422c3755f42d6091f2b8817b26f.zip |
Corrected a verification test
Diffstat (limited to 'src/commodity.cc')
-rw-r--r-- | src/commodity.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/commodity.cc b/src/commodity.cc index 1554887c..e45332b2 100644 --- a/src/commodity.cc +++ b/src/commodity.cc @@ -375,6 +375,7 @@ commodity_t::find_price(const optional<commodity_t&>& commodity, optional<base_t::time_and_commodity_t> pair; #if defined(VERIFY_ON) optional<price_point_t> checkpoint; + bool found = false; #endif if (! nested) { @@ -394,6 +395,7 @@ commodity_t::find_price(const optional<commodity_t&>& commodity, << ((*i).second ? (*i).second->price : amount_t(0L))); #if defined(VERIFY_ON) IF_VERIFY() { + found = true; checkpoint = (*i).second; } else #endif // defined(VERIFY_ON) @@ -422,7 +424,7 @@ commodity_t::find_price(const optional<commodity_t&>& commodity, const_cast<commodity_t&>(*this).drop_flags(COMMODITY_WALKED); #if defined(VERIFY_ON) - if (DO_VERIFY() && pair) { + if (DO_VERIFY() && found) { VERIFY(checkpoint == point); return checkpoint; } |