From 942943323ea1cef85b08935c98fb84b378519d3e Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Thu, 26 Aug 2004 14:31:50 -0400 Subject: don't placement new() amount_t in binary.cc when it isn't necessary --- amount.cc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'amount.cc') diff --git a/amount.cc b/amount.cc index e0507c7c..a99f7d73 100644 --- a/amount.cc +++ b/amount.cc @@ -906,15 +906,13 @@ void amount_t::write_quantity(std::ostream& out) const void amount_t::read_quantity(std::istream& in) { - assert(! quantity); - char byte; in.read(&byte, sizeof(byte)); - if (byte == 0) - return; - - if (byte == 1) { + if (byte == 0) { + quantity = NULL; + } + else if (byte == 1) { quantity = new(bigints_next++) bigint_t; quantity->flags |= BIGINT_BULK_ALLOC; -- cgit v1.2.3