From 7c3402307a1d927575b65a9e6dab878573260d55 Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Mon, 29 Jan 2024 09:25:56 +0900 Subject: [PATCH] Change type of parameters of methods The type of parameters is changed to the pointer type from the reference type. Change-Id: Iec66f44cdb3a75e9f3d65d3f0e9352bd4b9051f4 Signed-off-by: Hwankyu Jhun --- tizen-cpp/app-core-cpp/app_core_base.cc | 58 ++++++++++++++++----------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/tizen-cpp/app-core-cpp/app_core_base.cc b/tizen-cpp/app-core-cpp/app_core_base.cc index a5251b4..eaf7f51 100644 --- a/tizen-cpp/app-core-cpp/app_core_base.cc +++ b/tizen-cpp/app-core-cpp/app_core_base.cc @@ -165,11 +165,11 @@ class AppCoreBase::Impl { void UpdateRegion(); std::list SplitLanguage(const std::string& lang); std::string GetLanguage(std::string lang); - void AppendDefaultLangs(std::vector& lang_set); + void AppendDefaultLangs(std::vector* lang_set); std::string GetStringBefore(const char* str, const char* delim); std::map> GetLangTable(); - void AppendLangs(const std::string& lang, std::vector& lang_set, - std::map>& table); + void AppendLangs(const std::string& lang, std::vector* lang_set, + std::map>* table); void ChangeLang(); void OnFreezerSignal(); @@ -933,10 +933,10 @@ std::list AppCoreBase::Impl::SplitLanguage( return li; } -void AppCoreBase::Impl::AppendDefaultLangs(std::vector& langs) { - langs.push_back("en_US"); - langs.push_back("en_GB"); - langs.push_back("en"); +void AppCoreBase::Impl::AppendDefaultLangs(std::vector* langs) { + langs->push_back("en_US"); + langs->push_back("en_GB"); + langs->push_back("en"); } std::string AppCoreBase::Impl::GetStringBefore(const char* cstr, @@ -984,53 +984,53 @@ std::map> AppCoreBase::Impl::GetLangTable() { } void AppCoreBase::Impl::AppendLangs(const std::string& lang, - std::vector& langs, - std::map>& table) { + std::vector* langs, + std::map>* table) { if (lang.empty()) return; - langs.push_back(lang); + langs->push_back(lang); std::string extract_lang = GetStringBefore(lang.c_str(), "."); if (extract_lang.empty()) return; - if (std::find(langs.begin(), langs.end(), extract_lang) != langs.end()) + if (std::find(langs->begin(), langs->end(), extract_lang) != langs->end()) return; std::string parent_lang = GetStringBefore(extract_lang.c_str(), "_"); if (parent_lang.empty()) return; - if (table.find(parent_lang) == table.end()) + if (table->find(parent_lang) == table->end()) return; - auto it = table[parent_lang].find(extract_lang); - if (it != table[parent_lang].end()) { + auto it = (*table)[parent_lang].find(extract_lang); + if (it != (*table)[parent_lang].end()) { std::string value = *it; - if (std::find(langs.begin(), langs.end(), value) == langs.end()) - langs.push_back(std::move(value)); + if (std::find(langs->begin(), langs->end(), value) == langs->end()) + langs->push_back(std::move(value)); - table[parent_lang].erase(it); + (*table)[parent_lang].erase(it); return; } - it = table[parent_lang].find(parent_lang); - if (it != table[parent_lang].end()) { + it = (*table)[parent_lang].find(parent_lang); + if (it != (*table)[parent_lang].end()) { std::string value = *it; - if (std::find(langs.begin(), langs.end(), value) == langs.end()) - langs.push_back(std::move(value)); + if (std::find(langs->begin(), langs->end(), value) == langs->end()) + langs->push_back(std::move(value)); - table[parent_lang].erase(parent_lang); + (*table)[parent_lang].erase(parent_lang); return; } - if (!table[parent_lang].empty()) { - auto i = table[parent_lang].begin(); + if (!(*table)[parent_lang].empty()) { + auto i = (*table)[parent_lang].begin(); std::string value = *i; - if (std::find(langs.begin(), langs.end(), value) == langs.end()) - langs.push_back(std::move(value)); + if (std::find(langs->begin(), langs->end(), value) == langs->end()) + langs->push_back(std::move(value)); - table[parent_lang].erase(i); + (*table)[parent_lang].erase(i); } } @@ -1045,9 +1045,9 @@ std::string AppCoreBase::Impl::GetLanguage(std::string lang) { std::vector langs; for (auto& i : l) - AppendLangs(i, langs, table); + AppendLangs(i, &langs, &table); - AppendDefaultLangs(langs); + AppendDefaultLangs(&langs); std::string ret; for (auto& i : langs) { if (ret.empty()) -- 2.7.4