summaryrefslogtreecommitdiff
path: root/src/amount.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/amount.cc')
-rw-r--r--src/amount.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/amount.cc b/src/amount.cc
index c80ca14e..d1aa1655 100644
--- a/src/amount.cc
+++ b/src/amount.cc
@@ -867,10 +867,15 @@ bool amount_t::fits_in_long() const
return mpfr_fits_slong_p(tempf, GMP_RNDN);
}
-commodity_t& amount_t::commodity() const
+commodity_t * amount_t::commodity_ptr() const
{
return (has_commodity() ?
- *commodity_ : *commodity_pool_t::current_pool->null_commodity);
+ commodity_ : commodity_pool_t::current_pool->null_commodity);
+}
+
+commodity_t& amount_t::commodity() const
+{
+ return *commodity_ptr();
}
bool amount_t::has_commodity() const