summaryrefslogtreecommitdiff
path: root/src/commodity.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2007-05-07 10:27:21 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 03:38:39 -0400
commitd8498372037a4d0c272547ae48046b2182bcd4b1 (patch)
treeea3f228c5b6b20d71456e47a418e383669925d5f /src/commodity.cc
parenta71d48881e538630aa1d147d58365da84e6db91f (diff)
downloadfork-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.cc4
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 ?