summaryrefslogtreecommitdiff
path: root/src/amount.cc
diff options
context:
space:
mode:
authorCraig Earls <enderw88@gmail.com>2011-10-06 22:07:01 -0700
committerCraig Earls <enderw88@gmail.com>2011-10-06 22:07:01 -0700
commitb400d65be082165f44e769605aa6a78133cf6d9a (patch)
tree27b18ee35a5c4f60a10cf4f626e15ac30276040b /src/amount.cc
parente9ccb012c2c5ffe0e9f4916ee859bda95d9d4248 (diff)
parentf0791bbd7297e737d9e13d0b0bb21473b173b2a7 (diff)
downloadfork-ledger-b400d65be082165f44e769605aa6a78133cf6d9a.tar.gz
fork-ledger-b400d65be082165f44e769605aa6a78133cf6d9a.tar.bz2
fork-ledger-b400d65be082165f44e769605aa6a78133cf6d9a.zip
Merge remote branch 'upstream/next' into next
Diffstat (limited to 'src/amount.cc')
-rw-r--r--src/amount.cc8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/amount.cc b/src/amount.cc
index 1dc160cc..808f118d 100644
--- a/src/amount.cc
+++ b/src/amount.cc
@@ -152,7 +152,7 @@ namespace {
if (mpfr_asprintf(&buf, "%.*RNf", precision, tempfb) < 0)
throw_(amount_error,
_("Cannot output amount to a floating-point representation"));
-
+
DEBUG("amount.convert", "mpfr_print = " << buf
<< " (precision " << precision
<< ", zeros_prec " << zeros_prec << ")");
@@ -1049,16 +1049,12 @@ bool amount_t::parse(std::istream& in, const parse_flags_t& flags)
// Create the commodity if has not already been seen, and update the
// precision if something greater was used for the quantity.
- bool newly_created = false;
-
if (symbol.empty()) {
commodity_ = NULL;
} else {
commodity_ = commodity_pool_t::current_pool->find(symbol);
- if (! commodity_) {
+ if (! commodity_)
commodity_ = commodity_pool_t::current_pool->create(symbol);
- newly_created = true;
- }
assert(commodity_);
if (details)