From 566db7c116e5a482ded9ad33739c177ba9e63801 Mon Sep 17 00:00:00 2001 From: Chengyu Liu Date: Sat, 13 Jan 2024 17:16:11 +0800 Subject: [PATCH] fix: If the localFileMap is empty, do not continue execution(#2303) (#2312) Co-authored-by: liuchengyu --- src/rsync_client.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/rsync_client.cc b/src/rsync_client.cc index 06db0d7ffc..1963cad15a 100644 --- a/src/rsync_client.cc +++ b/src/rsync_client.cc @@ -456,6 +456,10 @@ Status RsyncClient::CleanUpExpiredFiles(bool need_reset_path, const std::set& expired_files, std::map* localFileMap) { + if (localFileMap->empty()) { + return Status::OK(); + } + for (const auto& item : expired_files) { localFileMap->erase(item); }