diff options
| author | AL <26797547+Al12rs@users.noreply.github.com> | 2020-11-02 23:20:43 +0100 |
|---|---|---|
| committer | AL <26797547+Al12rs@users.noreply.github.com> | 2020-11-02 23:20:43 +0100 |
| commit | c5e3fb423fd144faa2db8f2bb156adba6c003d39 (patch) | |
| tree | 823e38d3f0af39be96a4a2b2d8264b7c851ed08b /src/shared | |
| parent | 4814ba626e80f5137076556b687e59e6bbd8be34 (diff) | |
Change some for loops to use refs, prefer range loop where possible.
Diffstat (limited to 'src/shared')
| -rw-r--r-- | src/shared/fileentry.cpp | 2 | ||||
| -rw-r--r-- | src/shared/fileregister.cpp | 4 |
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 |
