From 653d2bd99a04f422c3755f42d6091f2b8817b26f Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sat, 5 Jun 2010 01:57:16 -0400 Subject: Corrected a verification test --- src/commodity.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/commodity.cc') 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, optional pair; #if defined(VERIFY_ON) optional checkpoint; + bool found = false; #endif if (! nested) { @@ -394,6 +395,7 @@ commodity_t::find_price(const optional& 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, const_cast(*this).drop_flags(COMMODITY_WALKED); #if defined(VERIFY_ON) - if (DO_VERIFY() && pair) { + if (DO_VERIFY() && found) { VERIFY(checkpoint == point); return checkpoint; } -- cgit v1.2.3