summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/account.cc7
-rw-r--r--src/value.cc16
-rw-r--r--src/value.h2
-rw-r--r--src/xact.cc17
4 files changed, 4 insertions, 38 deletions
diff --git a/src/account.cc b/src/account.cc
index 339d1ef4..104d0cee 100644
--- a/src/account.cc
+++ b/src/account.cc
@@ -161,11 +161,6 @@ namespace {
return account.xdata_->total;
}
- value_t get_total_cost(account_t& account) {
- assert(account.xdata_);
- return account.xdata_->total.cost();
- }
-
value_t get_amount(account_t& account) {
assert(account.xdata_);
return account.xdata_->value;
@@ -216,8 +211,6 @@ expr_t::ptr_op_t account_t::lookup(const string& name)
case 't':
if (name == "total")
return WRAP_FUNCTOR(get_wrapper<&get_total>);
- else if (name == "total_cost")
- return WRAP_FUNCTOR(get_wrapper<&get_total_cost>);
break;
}
diff --git a/src/value.cc b/src/value.cc
index 6e4574ca..9eb5b2e1 100644
--- a/src/value.cc
+++ b/src/value.cc
@@ -1245,22 +1245,6 @@ value_t value_t::strip_annotations(const keep_details_t& what_to_keep) const
return NULL_VALUE;
}
-value_t value_t::cost() const
-{
- switch (type()) {
- case INTEGER:
- case AMOUNT:
- case BALANCE:
- return *this;
-
- default:
- break;
- }
-
- throw_(value_error, "Cannot find the cost of " << label());
- return NULL_VALUE;
-}
-
void value_t::print(std::ostream& out,
const int first_width,
const int latter_width,
diff --git a/src/value.h b/src/value.h
index e5c76780..c24e8257 100644
--- a/src/value.h
+++ b/src/value.h
@@ -425,8 +425,6 @@ public:
// Return the "market value" of a given value at a specific time.
value_t value(const optional<datetime_t>& moment = none,
const optional<commodity_t&>& in_terms_of = none) const;
- value_t cost() const;
-
/**
* Truth tests.
diff --git a/src/xact.cc b/src/xact.cc
index 93e66369..83e36078 100644
--- a/src/xact.cc
+++ b/src/xact.cc
@@ -157,7 +157,7 @@ namespace {
value_t get_cost(xact_t& xact) {
if (xact.has_xdata() &&
xact.xdata().has_flags(XACT_EXT_COMPOUND)) {
- return xact.xdata().value.cost();
+ return xact.xdata().value;
} else {
if (xact.cost)
return *xact.cost;
@@ -173,18 +173,11 @@ namespace {
return xact.amount;
}
- value_t get_total_cost(xact_t& xact) {
+ value_t get_count(xact_t& xact) {
if (xact.xdata_)
- return xact.xdata_->total.cost();
- else if (xact.cost)
- return *xact.cost;
+ return xact.xdata_->count;
else
- return xact.amount;
- }
-
- value_t get_count(xact_t& xact) {
- assert(xact.xdata_);
- return xact.xdata_->count;
+ return 1L;
}
value_t get_account(call_scope_t& scope)
@@ -260,8 +253,6 @@ expr_t::ptr_op_t xact_t::lookup(const string& name)
case 't':
if (name[1] == '\0' || name == "total")
return WRAP_FUNCTOR(get_wrapper<&get_total>);
- else if (name == "total_cost")
- return WRAP_FUNCTOR(get_wrapper<&get_total_cost>);
break;
case 'v':