From ec019298bc01709bd6ee926e9c6d76f0b7c08f66 Mon Sep 17 00:00:00 2001 From: collin Date: Tue, 9 Nov 2021 08:43:03 -0500 Subject: simplify code copying applicationset --- .../src/commands/hmi/on_tts_language_change_notification.cc | 8 +------- .../src/commands/hmi/on_ui_language_change_notification.cc | 8 +------- .../src/commands/hmi/on_vr_language_change_notification.cc | 8 +------- 3 files changed, 3 insertions(+), 21 deletions(-) diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_language_change_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_language_change_notification.cc index 533740e193..51df69d0bc 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_language_change_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_language_change_notification.cc @@ -88,13 +88,7 @@ void OnTTSLanguageChangeNotification::Run() { (*message_)[strings::params][strings::function_id] = static_cast(mobile_apis::FunctionID::OnLanguageChangeID); - ApplicationSet apps; - - { - const ApplicationSet& accessor = - application_manager_.applications().GetData(); - apps = ApplicationSet(accessor); - } + auto apps = ApplicationSet(application_manager_.applications().GetData()); auto message_language = (*message_)[strings::msg_params][strings::language].asInt(); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_language_change_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_language_change_notification.cc index f0826e0612..8da7da28e7 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_language_change_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_language_change_notification.cc @@ -80,13 +80,7 @@ void OnUILanguageChangeNotification::Run() { (*message_)[strings::params][strings::function_id] = static_cast(mobile_apis::FunctionID::OnLanguageChangeID); - ApplicationSet apps; - - { - const ApplicationSet& accessor = - application_manager_.applications().GetData(); - apps = ApplicationSet(accessor); - } + auto apps = ApplicationSet(application_manager_.applications().GetData()); auto message_language = (*message_)[strings::msg_params][strings::hmi_display_language].asInt(); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_language_change_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_language_change_notification.cc index 062ec62623..9cb4653548 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_language_change_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_vr_language_change_notification.cc @@ -78,13 +78,7 @@ void OnVRLanguageChangeNotification::Run() { (*message_)[strings::params][strings::function_id] = static_cast(mobile_apis::FunctionID::OnLanguageChangeID); - ApplicationSet apps; - - { - const ApplicationSet& accessor = - application_manager_.applications().GetData(); - apps = ApplicationSet(accessor); - } + auto apps = ApplicationSet(application_manager_.applications().GetData()); auto message_language = (*message_)[strings::msg_params][strings::language].asInt(); -- cgit v1.2.1