From 5fed4d21b1f1f7d6530ef63a79ee3420a691d7d3 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Sat, 3 Jun 2023 01:51:36 +0200 Subject: [PATCH] Fix a few more clazy warnings --- src/Cache.cpp | 4 +++- src/encryption/Olm.cpp | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) 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",