diff options
author | John Wiegley <johnw@newartisans.com> | 2010-06-03 17:59:43 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2010-06-03 17:59:43 -0400 |
commit | e8bf3da053e7e1aa2aae01f179d94be414a62ff1 (patch) | |
tree | c1ed4073e35b59df4f9128b84b159f41060d0468 /src/amount.cc | |
parent | e6c5837b2ca85363b9dc5255592ca5e9da8900e1 (diff) | |
download | fork-ledger-e8bf3da053e7e1aa2aae01f179d94be414a62ff1.tar.gz fork-ledger-e8bf3da053e7e1aa2aae01f179d94be414a62ff1.tar.bz2 fork-ledger-e8bf3da053e7e1aa2aae01f179d94be414a62ff1.zip |
Short-circuit annotated commodity valuation
Diffstat (limited to 'src/amount.cc')
-rw-r--r-- | src/amount.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/amount.cc b/src/amount.cc index bcd4bb8c..d9b7c82c 100644 --- a/src/amount.cc +++ b/src/amount.cc @@ -737,7 +737,9 @@ amount_t::value(const bool primary_only, #endif if (has_commodity() && (! primary_only || ! commodity().has_flags(COMMODITY_PRIMARY))) { - if (in_terms_of && commodity() == *in_terms_of) { + if (in_terms_of && + (commodity() == *in_terms_of || + commodity().referent() == in_terms_of->referent())) { return *this; } else if (has_annotation() && annotation().price && |