OSDN Git Service

iterate over the QStringList objects that are not modified in QFileSystemWatcherEngin...
authorIvailo Monev <xakepa10@gmail.com>
Sat, 1 Oct 2022 16:55:54 +0000 (19:55 +0300)
committerIvailo Monev <xakepa10@gmail.com>
Sat, 1 Oct 2022 16:55:54 +0000 (19:55 +0300)
fixes possible reference issues

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
src/core/io/qfilesystemwatcher_unix.cpp

index d5b6600..085b877 100644 (file)
@@ -42,7 +42,7 @@ QStringList QFileSystemWatcherEngineUnix::addPaths(const QStringList &paths,
                                                       QStringList *directories)
 {
     QStringList p = paths;
-    foreach (const QString &path, p) {
+    foreach (const QString &path, paths) {
         QStatInfo fi(path, true);
         if (fi.isDir() || path.endsWith(QLatin1Char('/'))) {
             if (!directories->contains(path))
@@ -70,7 +70,7 @@ QStringList QFileSystemWatcherEngineUnix::removePaths(const QStringList &paths,
                                                          QStringList *directories)
 {
     QStringList p = paths;
-    foreach (const QString &path, p) {
+    foreach (const QString &path, paths) {
         if (this->directories.remove(path)) {
             directories->removeAll(path);
             p.removeAll(path);