diff options
author | John Wiegley <johnw@newartisans.com> | 2010-06-07 09:49:17 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2010-06-07 09:49:17 -0400 |
commit | be6cef93c479056169ab499d03ea212ff22db435 (patch) | |
tree | fba78156e5187bd690f519846427284cdc0b0193 /src/commodity.cc | |
parent | ae8ab8106218167036ef386159450b56c328f1b9 (diff) | |
download | fork-ledger-be6cef93c479056169ab499d03ea212ff22db435.tar.gz fork-ledger-be6cef93c479056169ab499d03ea212ff22db435.tar.bz2 fork-ledger-be6cef93c479056169ab499d03ea212ff22db435.zip |
A further simplification of -V and -X
With -X COMM, all values are computed in terms of COMM, regardless.
With -V, only secondary commodities will ever be computed, never
primaries. Further, if a secondary commodities has an associated price,
the valuation is done in terms of that price's commodity.
Diffstat (limited to 'src/commodity.cc')
-rw-r--r-- | src/commodity.cc | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/commodity.cc b/src/commodity.cc index e45332b2..9a757395 100644 --- a/src/commodity.cc +++ b/src/commodity.cc @@ -264,10 +264,6 @@ commodity_t::varied_history_t::find_price(const commodity_t& source, if (comm == source) continue; - // Only value secondary commodities in terms of primary ones - if (! commodity && ! comm.has_flags(COMMODITY_PRIMARY)) - continue; - DEBUG_INDENT("commodity.prices.find", indent + 1); DEBUG("commodity.prices.find", "searching for price via commodity '" << comm << "'"); @@ -370,8 +366,7 @@ commodity_t::find_price(const optional<commodity_t&>& commodity, #endif ) const { - if (! has_flags(COMMODITY_WALKED) && base->varied_history && - (commodity || ! has_flags(COMMODITY_PRIMARY))) { + if (! has_flags(COMMODITY_WALKED) && base->varied_history) { optional<base_t::time_and_commodity_t> pair; #if defined(VERIFY_ON) optional<price_point_t> checkpoint; |