summaryrefslogtreecommitdiff
path: root/src/numerics/commodity.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2007-05-23 00:36:26 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 03:39:07 -0400
commit84ead9153fe5d681276957688c5bf565bdf5b445 (patch)
treeecd0f330674f96a5557ae51ce6d45ef193693c9d /src/numerics/commodity.cc
parent5054147043f10241ec11b41195ff682090edfd2a (diff)
downloadfork-ledger-84ead9153fe5d681276957688c5bf565bdf5b445.tar.gz
fork-ledger-84ead9153fe5d681276957688c5bf565bdf5b445.tar.bz2
fork-ledger-84ead9153fe5d681276957688c5bf565bdf5b445.zip
Just a few minor corrections.
Diffstat (limited to 'src/numerics/commodity.cc')
-rw-r--r--src/numerics/commodity.cc19
1 files changed, 3 insertions, 16 deletions
diff --git a/src/numerics/commodity.cc b/src/numerics/commodity.cc
index 589ddd05..76614f92 100644
--- a/src/numerics/commodity.cc
+++ b/src/numerics/commodity.cc
@@ -123,18 +123,6 @@ commodity_t::operator bool() const
return this != parent().null_commodity;
}
-annotated_commodity_t& commodity_t::as_annotated()
-{
- assert(annotated);
- return downcast<annotated_commodity_t>(*this);
-}
-
-const annotated_commodity_t& commodity_t::as_annotated() const
-{
- assert(annotated);
- return downcast<const annotated_commodity_t>(*this);
-}
-
bool commodity_t::symbol_needs_quotes(const string& symbol)
{
for (const char * p = symbol.c_str(); *p; p++)
@@ -302,7 +290,7 @@ bool annotated_commodity_t::operator==(const commodity_t& comm) const
if (! comm.annotated)
return false;
- if (details != comm.as_annotated().details)
+ if (details != as_annotated_commodity(comm).details)
return false;
return true;
@@ -540,8 +528,7 @@ commodity_pool_t::find(const string& symbol, const annotation_t& details)
string name = make_qualified_name(*comm, details);
if (commodity_t * ann_comm = find(name)) {
- assert(ann_comm->annotated &&
- ann_comm->as_annotated().details);
+ assert(ann_comm->annotated && as_annotated_commodity(*ann_comm).details);
return ann_comm;
}
return NULL;
@@ -602,7 +589,7 @@ commodity_t * commodity_pool_t::find_or_create(commodity_t& comm,
assert(! name.empty());
if (commodity_t * ann_comm = find(name)) {
- assert(ann_comm->annotated && ann_comm->as_annotated().details);
+ assert(ann_comm->annotated && as_annotated_commodity(*ann_comm).details);
return ann_comm;
}
return create(comm, details, name);