From 0749a1f94c46f72d14b74a72676f89bf697d1763 Mon Sep 17 00:00:00 2001 From: Jin1K <1061208093@qq.com> Date: Wed, 4 Jun 2025 17:50:06 +0800 Subject: [PATCH] print Signed-off-by: Jin1K <1061208093@qq.com> --- .../published_data_subscriber_manager.cpp | 8 ++++---- .../subscriber_managers/rdb_subscriber_manager.cpp | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/services/distributeddataservice/service/data_share/subscriber_managers/published_data_subscriber_manager.cpp b/services/distributeddataservice/service/data_share/subscriber_managers/published_data_subscriber_manager.cpp index 05d7affb5..daa94de55 100644 --- a/services/distributeddataservice/service/data_share/subscriber_managers/published_data_subscriber_manager.cpp +++ b/services/distributeddataservice/service/data_share/subscriber_managers/published_data_subscriber_manager.cpp @@ -84,7 +84,7 @@ void PublishedDataSubscriberManager::Delete(uint32_t callerTokenId, uint32_t cal int PublishedDataSubscriberManager::Disable(const PublishedDataKey &key, uint32_t firstCallerTokenId) { - auto result = + bool result = publishedDataCache_.ComputeIfPresent(key, [&firstCallerTokenId](const auto &key, std::vector &value) { for (auto it = value.begin(); it != value.end(); it++) { @@ -95,7 +95,7 @@ int PublishedDataSubscriberManager::Disable(const PublishedDataKey &key, uint32_ } return true; }); - if (result != E_OK) { + if (!result) { ZLOGE("disable failed, uri is %{public}s, bundleName is %{public}s, subscriberId is %{public}" PRId64, DistributedData::Anonymous::Change(key.key).c_str(), key.bundleName.c_str(), key.subscriberId); } @@ -104,7 +104,7 @@ int PublishedDataSubscriberManager::Disable(const PublishedDataKey &key, uint32_ int PublishedDataSubscriberManager::Enable(const PublishedDataKey &key, uint32_t firstCallerTokenId) { - auto result = + bool result = publishedDataCache_.ComputeIfPresent(key, [&firstCallerTokenId](const auto &key, std::vector &value) { for (auto it = value.begin(); it != value.end(); it++) { @@ -114,7 +114,7 @@ int PublishedDataSubscriberManager::Enable(const PublishedDataKey &key, uint32_t } return true; }); - if (result != E_OK) { + if (!result) { ZLOGE("enable failed, uri is %{public}s, bundleName is %{public}s, subscriberId is %{public}" PRId64, DistributedData::Anonymous::Change(key.key).c_str(), key.bundleName.c_str(), key.subscriberId); } diff --git a/services/distributeddataservice/service/data_share/subscriber_managers/rdb_subscriber_manager.cpp b/services/distributeddataservice/service/data_share/subscriber_managers/rdb_subscriber_manager.cpp index 4f91e060d..d5245715c 100644 --- a/services/distributeddataservice/service/data_share/subscriber_managers/rdb_subscriber_manager.cpp +++ b/services/distributeddataservice/service/data_share/subscriber_managers/rdb_subscriber_manager.cpp @@ -187,7 +187,7 @@ void RdbSubscriberManager::Delete(uint32_t callerTokenId, uint32_t callerPid) int RdbSubscriberManager::Disable(const Key &key, uint32_t firstCallerTokenId) { bool isAllDisabled = true; - auto result = + bool result = rdbCache_.ComputeIfPresent(key, [&firstCallerTokenId, &isAllDisabled, this](const auto &key, std::vector &value) { for (auto it = value.begin(); it != value.end(); it++) { @@ -204,7 +204,7 @@ int RdbSubscriberManager::Disable(const Key &key, uint32_t firstCallerTokenId) if (isAllDisabled) { SchedulerManager::GetInstance().Disable(key); } - if (result != E_OK) { + if (!result) { ZLOGE("disable failed, uri is %{public}s, bundleName is %{public}s, subscriberId is %{public}" PRId64, DistributedData::Anonymous::Change(key.uri).c_str(), key.bundleName.c_str(), key.subscriberId); } @@ -215,7 +215,7 @@ int RdbSubscriberManager::Enable(const Key &key, std::shared_ptr contex { bool isChanged = false; DistributedData::StoreMetaData metaData; - auto result = rdbCache_.ComputeIfPresent(key, [&context, &metaData, &isChanged, this](const auto &key, + bool result = rdbCache_.ComputeIfPresent(key, [&context, &metaData, &isChanged, this](const auto &key, std::vector &value) { for (auto it = value.begin(); it != value.end(); it++) { if (it->firstCallerTokenId != context->callerTokenId) { @@ -239,7 +239,7 @@ int RdbSubscriberManager::Enable(const Key &key, std::shared_ptr contex if (isChanged) { SchedulerManager::GetInstance().Enable(key, context->visitedUserId, metaData); } - if (result != E_OK) { + if (!result) { ZLOGE("enable failed, uri is %{public}s, bundleName is %{public}s, subscriberId is %{public}" PRId64, DistributedData::Anonymous::Change(key.uri).c_str(), key.bundleName.c_str(), key.subscriberId); } -- Gitee