From 543c95e19297db4cee9ae64dfe770fd04997a7f0 Mon Sep 17 00:00:00 2001 From: genglingxia Date: Fri, 26 May 2023 11:08:10 +0800 Subject: [PATCH] codecheck 0526 Signed-off-by: genglingxia --- framework/manager/store/runtime_store.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/framework/manager/store/runtime_store.cpp b/framework/manager/store/runtime_store.cpp index 11fafd7..48f6331 100755 --- a/framework/manager/store/runtime_store.cpp +++ b/framework/manager/store/runtime_store.cpp @@ -242,11 +242,11 @@ std::vector RuntimeStore::GetEntries(const std::string &dataPrefix) Status RuntimeStore::PutEntries(const std::vector &entries) { - auto size = entries.size(); + size_t size = entries.size(); DistributedKv::Status status; - for (int32_t index = 0; index < size; index += MAX_BATCH_SIZE) { + for (size_t index = 0; index < size; index += MAX_BATCH_SIZE) { std::vector batchEntries(entries.begin() + index, - entries.begin() + std::min(index + MAX_BATCH_SIZE, static_cast(size))); + entries.begin() + std::min(index + MAX_BATCH_SIZE, size)); status = kvStore_->PutBatch(batchEntries); if (status != DistributedKv::Status::SUCCESS) { LOG_ERROR(UDMF_SERVICE, "KvStore putBatch failed, status: %{public}d.", status); @@ -258,11 +258,11 @@ Status RuntimeStore::PutEntries(const std::vector &entries) Status RuntimeStore::DeleteEntries(const std::vector &keys) { - auto size = keys.size(); + size_t size = keys.size(); DistributedKv::Status status; - for (int32_t index = 0; index < size; index += MAX_BATCH_SIZE) { + for (size_t index = 0; index < size; index += MAX_BATCH_SIZE) { std::vector batchKeys(keys.begin() + index, - keys.begin() + std::min(index + MAX_BATCH_SIZE, static_cast(size))); + keys.begin() + std::min(index + MAX_BATCH_SIZE, size)); status = kvStore_->DeleteBatch(batchKeys); if (status != DistributedKv::Status::SUCCESS) { LOG_ERROR(UDMF_SERVICE, "KvStore deleteBatch failed, status: %{public}d.", status); -- Gitee