From 7d6cad9c883f7dbd0d7a941f5a8f3af604aeb91c Mon Sep 17 00:00:00 2001 From: bangerth Date: Mon, 3 Oct 2011 02:22:36 +0000 Subject: [PATCH] Simplify code slightly. git-svn-id: https://svn.dealii.org/trunk@24505 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/source/base/logstream.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/deal.II/source/base/logstream.cc b/deal.II/source/base/logstream.cc index 0a1b9b5604..2c8c1839e9 100644 --- a/deal.II/source/base/logstream.cc +++ b/deal.II/source/base/logstream.cc @@ -143,13 +143,13 @@ LogStream::get_stream() Threads::ThreadMutex::ScopedLock lock(log_lock); const unsigned int id = Threads::this_thread_id(); - std_cxx1x::shared_ptr& sptr = outstreams[id]; - if (sptr == std_cxx1x::shared_ptr()) + // if necessary allocate a stream object + if (outstreams.find (id) == outstreams.end()) { - sptr = std_cxx1x::shared_ptr (new std::ostringstream()); - sptr->setf(std::ios::showpoint | std::ios::left); + outstreams[id].reset (new std::ostringstream()); + outstreams[id]->setf(std::ios::showpoint | std::ios::left); } - return *sptr; + return *outstreams[id]; } -- 2.39.5