diff --git a/src/Cache.cpp b/src/Cache.cpp index 2d87304c..7671af02 100644 --- a/src/Cache.cpp +++ b/src/Cache.cpp @@ -4424,7 +4424,9 @@ Cache::displayName(const QString &room_id, const QString &user_id) static bool isDisplaynameSafe(const std::string &s) { - for (QChar c : QString::fromStdString(s)) { + const auto str = QString::fromStdString(s); + + for (QChar c : str) { if (c.isPrint() && !c.isSpace()) return false; } diff --git a/src/encryption/Olm.cpp b/src/encryption/Olm.cpp index 733ce94f..b4310f26 100644 --- a/src/encryption/Olm.cpp +++ b/src/encryption/Olm.cpp @@ -1363,12 +1363,12 @@ send_encrypted_to_device_messages(const std::mapwarn("Not creating new session with {}:{} " "because of rate limit",