From ec1f15a4b2ae706dd99aff0d506977486ffef08b Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Wed, 7 Mar 2012 10:32:35 -0600 Subject: Made amount_t::price return an optional --- src/amount.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/amount.cc') diff --git a/src/amount.cc b/src/amount.cc index 313f8d27..c80ca14e 100644 --- a/src/amount.cc +++ b/src/amount.cc @@ -787,7 +787,7 @@ amount_t::value(const optional& moment, return none; } -amount_t amount_t::price() const +optional amount_t::price() const { if (has_annotation() && annotation().price) { amount_t tmp(*annotation().price); @@ -795,7 +795,7 @@ amount_t amount_t::price() const DEBUG("amount.price", "Returning price of " << *this << " = " << tmp); return tmp; } - return *this; + return none; } -- cgit v1.2.3