From: bangerth Date: Mon, 3 Oct 2011 02:22:36 +0000 (+0000) Subject: Simplify code slightly. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7d6cad9c883f7dbd0d7a941f5a8f3af604aeb91c;p=dealii-svn.git Simplify code slightly. git-svn-id: https://svn.dealii.org/trunk@24505 0785d39b-7218-0410-832d-ea1e28bc413d --- 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]; }