Short-circuit annotated commodity valuation
This commit is contained in:
parent
e6c5837b2c
commit
e8bf3da053
1 changed files with 3 additions and 1 deletions
|
|
@ -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 &&
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue