summaryrefslogtreecommitdiff
path: root/src/value.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2012-03-11 03:55:25 -0500
committerJohn Wiegley <johnw@newartisans.com>2012-03-11 03:55:25 -0500
commit363670d35bf451ff8ce636c071da73a0d93c514a (patch)
tree153899e85596849bcbe96c820d5d55bbc61f1d8b /src/value.cc
parent2303aa993cf41ad5bde8f8f5722bd265c11e3aa7 (diff)
downloadfork-ledger-363670d35bf451ff8ce636c071da73a0d93c514a.tar.gz
fork-ledger-363670d35bf451ff8ce636c071da73a0d93c514a.tar.bz2
fork-ledger-363670d35bf451ff8ce636c071da73a0d93c514a.zip
Tighten up argument passing related to fn_market()
Diffstat (limited to 'src/value.cc')
-rw-r--r--src/value.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/value.cc b/src/value.cc
index c4e7170d..cae2a356 100644
--- a/src/value.cc
+++ b/src/value.cc
@@ -1399,8 +1399,8 @@ bool value_t::is_zero() const
return false;
}
-value_t value_t::value(const optional<datetime_t>& moment,
- const optional<commodity_t&>& in_terms_of) const
+value_t value_t::value(const datetime_t& moment,
+ const commodity_t * in_terms_of) const
{
switch (type()) {
case INTEGER:
@@ -1432,9 +1432,9 @@ value_t value_t::value(const optional<datetime_t>& moment,
return NULL_VALUE;
}
-value_t value_t::exchange_commodities(const std::string& commodities,
- const bool add_prices,
- const optional<datetime_t>& moment)
+value_t value_t::exchange_commodities(const std::string& commodities,
+ const bool add_prices,
+ const datetime_t& moment)
{
if (type() == SEQUENCE) {
value_t temp;
@@ -1447,7 +1447,7 @@ value_t value_t::exchange_commodities(const std::string& commodities,
// expression, skip the expensive logic below.
if (commodities.find(',') == string::npos &&
commodities.find('=') == string::npos)
- return value(moment, *commodity_pool_t::current_pool->find_or_create(commodities));
+ return value(moment, commodity_pool_t::current_pool->find_or_create(commodities));
std::vector<commodity_t *> comms;
std::vector<bool> force;
@@ -1479,7 +1479,7 @@ value_t value_t::exchange_commodities(const std::string& commodities,
break;
DEBUG("commodity.exchange", "Referent doesn't match, pricing...");
- if (optional<amount_t> val = as_amount_lval().value(moment, *comm)) {
+ if (optional<amount_t> val = as_amount_lval().value(moment, comm)) {
DEBUG("commodity.exchange", "Re-priced amount is: " << *val);
return *val;
}
@@ -1502,7 +1502,7 @@ value_t value_t::exchange_commodities(const std::string& commodities,
temp += pair.second;
} else {
DEBUG("commodity.exchange", "Referent doesn't match, pricing...");
- if (optional<amount_t> val = pair.second.value(moment, *comm)) {
+ if (optional<amount_t> val = pair.second.value(moment, comm)) {
DEBUG("commodity.exchange", "Re-priced member amount is: " << *val);
temp += *val;
repriced = true;