diff options
author | John Wiegley <johnw@newartisans.com> | 2012-03-07 10:32:35 -0600 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2012-03-07 10:32:35 -0600 |
commit | ec1f15a4b2ae706dd99aff0d506977486ffef08b (patch) | |
tree | ae7df4c38aa532794644722066f37e3a481ec3d8 /src/amount.cc | |
parent | b1107f85ae07a85124e58a0e379ec2d9ab47d119 (diff) | |
download | fork-ledger-ec1f15a4b2ae706dd99aff0d506977486ffef08b.tar.gz fork-ledger-ec1f15a4b2ae706dd99aff0d506977486ffef08b.tar.bz2 fork-ledger-ec1f15a4b2ae706dd99aff0d506977486ffef08b.zip |
Made amount_t::price return an optional<amount_t>
Diffstat (limited to 'src/amount.cc')
-rw-r--r-- | src/amount.cc | 4 |
1 files changed, 2 insertions, 2 deletions
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<datetime_t>& moment, return none; } -amount_t amount_t::price() const +optional<amount_t> 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; } |