Blob Blame History Raw
From d46d05e67c729902e30691fc5f013504c8734ba4 Mon Sep 17 00:00:00 2001
From: Carl Schwan <carl@carlschwan.eu>
Date: Tue, 25 Apr 2023 19:40:09 +0200
Subject: [PATCH] Remove dangling reference

remoteCollection.contentMimeTypes() creates a temporary which is deleted
at the end of the expression. This was a compiler warning.

(cherry picked from commit d9476fd48863a46d4ef5deac4d8a0c7fbdb1c6c5)
---
 src/core/collectionsync.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/core/collectionsync.cpp b/src/core/collectionsync.cpp
index 6195b501e..c8817676e 100644
--- a/src/core/collectionsync.cpp
+++ b/src/core/collectionsync.cpp
@@ -376,8 +376,8 @@ public:
                 return true;
             } else {
                 for (int i = 0, total = remoteCollection.contentMimeTypes().size(); i < total; ++i) {
-                    const QString &m = remoteCollection.contentMimeTypes().at(i);
-                    if (!localCollection.contentMimeTypes().contains(m)) {
+                    const QString mimetype = remoteCollection.contentMimeTypes().at(i);
+                    if (!localCollection.contentMimeTypes().contains(mimetype)) {
                         return true;
                     }
                 }
-- 
2.40.0