minor speed optimization
authorGerd von Egidy <gerd.von.egidy@intra2net.com>
Wed, 16 Dec 2015 10:55:30 +0000 (11:55 +0100)
committerGerd von Egidy <gerd.von.egidy@intra2net.com>
Wed, 16 Dec 2015 10:55:30 +0000 (11:55 +0100)
src/stringfunc.cpp

index 338e3b1..f41f9c6 100644 (file)
@@ -924,7 +924,8 @@ std::string sanitize_for_logging(const std::string &str, const char replace_with
 {
     std::string output=str;
 
-    for (std::string::size_type p=0; p < output.size(); p++)
+    const string::size_type len = output.size();
+    for (std::string::size_type p=0; p < len; p++)
         if (output[p] < 0x20 || output[p] > 0x7E)
             output[p]=replace_with;