summaryrefslogtreecommitdiff
path: root/FreeFileSync/Source/lib/binary.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'FreeFileSync/Source/lib/binary.cpp')
-rw-r--r--FreeFileSync/Source/lib/binary.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/FreeFileSync/Source/lib/binary.cpp b/FreeFileSync/Source/lib/binary.cpp
index 0e41f7a6..0d62f0ec 100644
--- a/FreeFileSync/Source/lib/binary.cpp
+++ b/FreeFileSync/Source/lib/binary.cpp
@@ -69,7 +69,7 @@ const std::int64_t TICKS_PER_SEC = ticksPerSec();
}
-bool zen::filesHaveSameContent(const Zstring& filename1, const Zstring& filename2, CompareCallback& callback)
+bool zen::filesHaveSameContent(const Zstring& filename1, const Zstring& filename2, const std::function<void(Int64 bytesDelta)>& onUpdateStatus)
{
static boost::thread_specific_ptr<std::vector<char>> cpyBuf1;
static boost::thread_specific_ptr<std::vector<char>> cpyBuf2;
@@ -98,7 +98,8 @@ bool zen::filesHaveSameContent(const Zstring& filename1, const Zstring& filename
const size_t length1 = file1.read(&memory1[0], bufferSize); //throw FileError
const size_t length2 = file2.read(&memory2[0], bufferSize); //returns actual number of bytes read
//send progress updates immediately after reading to reliably allow speed calculations for our clients!
- callback.updateCompareStatus(to<Int64>(std::max(length1, length2)));
+ if (onUpdateStatus)
+ onUpdateStatus(to<Int64>(std::max(length1, length2)));
if (length1 != length2 || ::memcmp(&memory1[0], &memory2[0], length1) != 0)
return false;
bgstack15