]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Simplify code slightly.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 3 Oct 2011 02:22:36 +0000 (02:22 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 3 Oct 2011 02:22:36 +0000 (02:22 +0000)
git-svn-id: https://svn.dealii.org/trunk@24505 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/source/base/logstream.cc

index 0a1b9b5604706f622d2ebf4a4aad390e9968ad41..2c8c1839e93071e9cacc4dac111604002cd451aa 100644 (file)
@@ -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<std::ostringstream>& sptr = outstreams[id];
-  if (sptr == std_cxx1x::shared_ptr<std::ostringstream>())
+                                  // if necessary allocate a stream object
+  if (outstreams.find (id) == outstreams.end())
     {
-      sptr = std_cxx1x::shared_ptr<std::ostringstream> (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];
 }
 
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.