summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/fileentry.cpp2
-rw-r--r--src/shared/fileregister.cpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/shared/fileentry.cpp b/src/shared/fileentry.cpp
index 559eae64..5be9a9dc 100644
--- a/src/shared/fileentry.cpp
+++ b/src/shared/fileentry.cpp
@@ -192,7 +192,7 @@ bool FileEntry::isFromArchive(std::wstring archiveName) const
return true;
}
- for (auto alternative : m_Alternatives) {
+ for (const auto& alternative : m_Alternatives) {
if (alternative.archive().name().compare(archiveName) == 0) {
return true;
}
diff --git a/src/shared/fileregister.cpp b/src/shared/fileregister.cpp
index f9d57734..98e49452 100644
--- a/src/shared/fileregister.cpp
+++ b/src/shared/fileregister.cpp
@@ -171,8 +171,8 @@ void FileRegister::unregisterFile(FileEntryPtr file)
m_OriginConnection->getByID(originID).removeFile(file->getIndex());
const auto& alternatives = file->getAlternatives();
- for (auto iter = alternatives.begin(); iter != alternatives.end(); ++iter) {
- m_OriginConnection->getByID(iter->originID()).removeFile(file->getIndex());
+ for (const auto& alt : alternatives) {
+ m_OriginConnection->getByID(alt.originID()).removeFile(file->getIndex());
}
// unregister from directory