diff options
author | John Wiegley <johnw@newartisans.com> | 2007-05-07 10:27:21 +0000 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-04-13 03:38:39 -0400 |
commit | d8498372037a4d0c272547ae48046b2182bcd4b1 (patch) | |
tree | ea3f228c5b6b20d71456e47a418e383669925d5f /src/commodity.cc | |
parent | a71d48881e538630aa1d147d58365da84e6db91f (diff) | |
download | fork-ledger-d8498372037a4d0c272547ae48046b2182bcd4b1.tar.gz fork-ledger-d8498372037a4d0c272547ae48046b2182bcd4b1.tar.bz2 fork-ledger-d8498372037a4d0c272547ae48046b2182bcd4b1.zip |
Major restructuring of the value_t class.
Diffstat (limited to 'src/commodity.cc')
-rw-r--r-- | src/commodity.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/commodity.cc b/src/commodity.cc index de801898..b94aedc7 100644 --- a/src/commodity.cc +++ b/src/commodity.cc @@ -54,7 +54,7 @@ void commodity_t::add_price(const moment_t& date, (*i).second = price; } else { std::pair<history_map::iterator, bool> result - = base->history->prices.insert(history_pair(date, price)); + = base->history->prices.insert(history_map::value_type(date, price)); assert(result.second); } } @@ -107,7 +107,7 @@ optional<amount_t> commodity_t::value(const optional<moment_t>& moment) } } - if (! (flags() & COMMODITY_STYLE_NOMARKET)) { + if (! has_flags(COMMODITY_STYLE_NOMARKET) && parent().get_quote) { if (optional<amount_t> quote = parent().get_quote (*this, age, moment, (base->history && base->history->prices.size() > 0 ? |