From 72b73f901f278f15679f35179c4e8f06d67c1be1 Mon Sep 17 00:00:00 2001 From: wanderer-dl122 Date: Wed, 19 Oct 2022 09:17:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9cpp=20check=20=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wanderer-dl122 --- .../distributedhardwarefwkservice/src/task/offline_task.cpp | 2 +- services/distributedhardwarefwkservice/src/task/online_task.cpp | 2 +- .../test/unittest/common/task/src/mock_offline_task.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/services/distributedhardwarefwkservice/src/task/offline_task.cpp b/services/distributedhardwarefwkservice/src/task/offline_task.cpp index d73ae1f4..de8508e6 100644 --- a/services/distributedhardwarefwkservice/src/task/offline_task.cpp +++ b/services/distributedhardwarefwkservice/src/task/offline_task.cpp @@ -54,7 +54,7 @@ void OffLineTask::DoTaskInner() { DHLOGD("start offline task, id = %s, uuid = %s", GetId().c_str(), GetAnonyString(GetUUID()).c_str()); this->SetTaskState(TaskState::RUNNING); - for (auto& step : this->GetTaskSteps()) { + for (const auto& step : this->GetTaskSteps()) { switch (step) { case TaskStep::UNREGISTER_OFFLINE_DISTRIBUTED_HARDWARE: { CreateDisableTask(); diff --git a/services/distributedhardwarefwkservice/src/task/online_task.cpp b/services/distributedhardwarefwkservice/src/task/online_task.cpp index 8f65bb36..b5475d40 100644 --- a/services/distributedhardwarefwkservice/src/task/online_task.cpp +++ b/services/distributedhardwarefwkservice/src/task/online_task.cpp @@ -47,7 +47,7 @@ void OnLineTask::DoTask() { DHLOGD("start online task, id = %s, uuid = %s", GetId().c_str(), GetAnonyString(GetUUID()).c_str()); this->SetTaskState(TaskState::RUNNING); - for (auto& step : this->GetTaskSteps()) { + for (const auto& step : this->GetTaskSteps()) { switch (step) { case TaskStep::SYNC_ONLINE_INFO: { DoSyncInfo(); diff --git a/services/distributedhardwarefwkservice/test/unittest/common/task/src/mock_offline_task.cpp b/services/distributedhardwarefwkservice/test/unittest/common/task/src/mock_offline_task.cpp index ad52c38f..b30914ec 100644 --- a/services/distributedhardwarefwkservice/test/unittest/common/task/src/mock_offline_task.cpp +++ b/services/distributedhardwarefwkservice/test/unittest/common/task/src/mock_offline_task.cpp @@ -30,7 +30,7 @@ MockOffLineTask::MockOffLineTask(const std::string &networkId, const std::string void MockOffLineTask::CreateDisableTask() { - for (auto &devInfo : offLineDevInfos) { + for (const auto &devInfo : offLineDevInfos) { TaskParam taskParam = { .networkId = devInfo.networkId, .uuid = devInfo.uuid, -- Gitee