From b7f8e71a6acec78b628161ea8473ddad9ea102b9 Mon Sep 17 00:00:00 2001 From: Peter Petrik Date: Tue, 3 Oct 2023 09:02:13 +0200 Subject: [PATCH] small formatting tweaks --- core/checksum.cpp | 1 - core/checksum.h | 2 -- core/merginapi.cpp | 9 +++++---- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/core/checksum.cpp b/core/checksum.cpp index 202304f000..c59d1e13c8 100644 --- a/core/checksum.cpp +++ b/core/checksum.cpp @@ -83,7 +83,6 @@ QString Checksum::get( const QString &path ) else { // invalid entry - remove from cache and recalculate - mCacheModified = true; mCache.remove( path ); } } diff --git a/core/checksum.h b/core/checksum.h index 696689b37b..2281e1b59a 100644 --- a/core/checksum.h +++ b/core/checksum.h @@ -55,6 +55,4 @@ class Checksum bool mCacheModified = false; }; - - #endif diff --git a/core/merginapi.cpp b/core/merginapi.cpp index 2038f30c41..03744c23ae 100644 --- a/core/merginapi.cpp +++ b/core/merginapi.cpp @@ -2822,17 +2822,15 @@ bool MerginApi::projectFilesEqual( { QHash oldServerFilesMap; - for ( MerginFile file : oldServerFiles ) + for ( const MerginFile &file : oldServerFiles ) { oldServerFilesMap.insert( file.path, file ); } - for ( MerginFile localFile : localFiles ) + for ( const MerginFile &localFile : localFiles ) { QString filePath = localFile.path; bool hasOldServer = oldServerFilesMap.contains( localFile.path ); - QString chkOld = oldServerFilesMap.value( localFile.path ).checksum; - QString chkLocal = localFile.checksum; if ( !hasOldServer ) { @@ -2841,6 +2839,9 @@ bool MerginApi::projectFilesEqual( } else { + const QString chkOld = oldServerFilesMap.value( localFile.path ).checksum; + const QString chkLocal = localFile.checksum; + if ( chkOld != chkLocal ) { if ( isFileDiffable( filePath ) )