[mlpack-git] master: Update prefixedoutstream_impl.hpp (76e48a5)

gitdub at mlpack.org gitdub at mlpack.org
Tue Mar 1 15:45:44 EST 2016


Repository : https://github.com/mlpack/mlpack
On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/fd84f3a2e53592d723a8e8a76dadb8aa76820913...1a9c41a86be1fa1dcc5c3b90dd959c2255c3bb8e

>---------------------------------------------------------------

commit 76e48a5fc640c5331799734ca1bbc8fdb2af8fb9
Author: Grzegorz Krajewski <krajekg at gmail.com>
Date:   Tue Mar 1 21:45:44 2016 +0100

    Update prefixedoutstream_impl.hpp


>---------------------------------------------------------------

76e48a5fc640c5331799734ca1bbc8fdb2af8fb9
 src/mlpack/core/util/prefixedoutstream_impl.hpp | 30 ++++++++++++-------------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/src/mlpack/core/util/prefixedoutstream_impl.hpp b/src/mlpack/core/util/prefixedoutstream_impl.hpp
index fd1f164..8c6ccda 100644
--- a/src/mlpack/core/util/prefixedoutstream_impl.hpp
+++ b/src/mlpack/core/util/prefixedoutstream_impl.hpp
@@ -67,31 +67,31 @@ void PrefixedOutStream::BaseLogic(const T& val)
     }
 
     // Now, we need to check for newlines in retrieved backtrace.
-    // If we find one, output up until the newline, then output the newline
-    // and the prefix and continue looking.
+    //If we find one, output up until the newline, then output the newline
+    //and the prefix and continue looking.
     size_t nl;
     size_t pos = 0;
 #ifdef HAS_BFD_DL
-    if(fatal)
-    {
-      Backtrace bt;
-      std::string btLine = bt.ToString();
-      while ((nl = btLine.find('\n', pos)) != std::string::npos)
+      if(fatal)
       {
-	PrefixIfNeeded();
+	Backtrace bt;
+	std::string btLine = bt.ToString();
+	while ((nl = btLine.find('\n', pos)) != std::string::npos)
+	{
+	  PrefixIfNeeded();
 	  
-	destination << btLine.substr(pos, nl - pos);
-	destination << std::endl;
-	newlined = true;
+	  destination << btLine.substr(pos, nl - pos);
+	  destination << std::endl;
+	  newlined = true;
 	    
-	carriageReturned = true; // Regardless of whether or not we display it.
+	  carriageReturned = true; // Regardless of whether or not we display it.
       
-	pos = nl + 1;
+	  pos = nl + 1;
+	}
+	pos = 0;
       }
-    }
 #endif
     //The same logic like above, but this time for 'line'.
-    pos = 0;
     while ((nl = line.find('\n', pos)) != std::string::npos)
     {
       PrefixIfNeeded();




More information about the mlpack-git mailing list