fix object cppcheck

Signed-off-by: guoqi11 <guoqi53@huawei.com>
This commit is contained in:
guoqi11 2024-08-31 16:06:44 +08:00
parent 4e19b4fa6a
commit 938abdb280
2 changed files with 4 additions and 4 deletions

View File

@ -497,8 +497,8 @@ void ObjectStoreManager::ComputeStatus(const std::string& objectKey, const SaveI
});
}
void ObjectStoreManager::NotifyDataChanged(std::map<std::string, std::map<std::string, std::vector<uint8_t>>>& data,
const SaveInfo& saveInfo)
void ObjectStoreManager::NotifyDataChanged(const std::map<std::string, std::map<std::string,
std::vector<uint8_t>>>& data, const SaveInfo& saveInfo)
{
for (auto const& [objectKey, results] : data) {
restoreStatus_.ComputeIfAbsent(
@ -1217,7 +1217,7 @@ int32_t ObjectStoreManager::OnAssetChanged(const uint32_t tokenId, const std::st
auto snapshotKey = appId + SEPERATOR + sessionId;
int32_t res = OBJECT_SUCCESS;
bool exist = snapshots_.ComputeIfPresent(snapshotKey,
[&res, &dataAsset, &deviceId](std::string key, std::shared_ptr<Snapshot> snapshot) {
[&res, &dataAsset, &deviceId](const std::string key, std::shared_ptr<Snapshot> snapshot) {
if (snapshot != nullptr) {
res = snapshot->OnDataChanged(dataAsset, deviceId); // needChange
}

View File

@ -178,7 +178,7 @@ private:
bool RegisterAssetsLister();
void ComputeStatus(const std::string& objectKey, const SaveInfo& saveInfo,
const std::map<std::string, std::map<std::string, std::vector<uint8_t>>>& data);
void NotifyDataChanged(std::map<std::string, std::map<std::string, std::vector<uint8_t>>>& data,
void NotifyDataChanged(const std::map<std::string, std::map<std::string, std::vector<uint8_t>>>& data,
const SaveInfo& saveInfo);
int32_t PushAssets(int32_t userId, const std::string &appId, const std::string &sessionId,
const std::map<std::string, std::vector<uint8_t>> &data, const std::string &deviceId);