From c0e32d64ac4e601b563ad837cc6dd9d32bfbe0b0 Mon Sep 17 00:00:00 2001 From: Gerd von Egidy Date: Wed, 16 Dec 2015 11:55:30 +0100 Subject: [PATCH] minor speed optimization --- src/stringfunc.cpp | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/src/stringfunc.cpp b/src/stringfunc.cpp index 338e3b1..f41f9c6 100644 --- a/src/stringfunc.cpp +++ b/src/stringfunc.cpp @@ -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; -- 1.7.1