From cfceb4c14b359be1dab5aac29c0ee019361bc2ed Mon Sep 17 00:00:00 2001 From: Viktor Govako Date: Wed, 19 Jan 2022 18:24:00 +0300 Subject: [PATCH] Minor code prettify. Signed-off-by: Viktor Govako --- coding/transliteration.cpp | 5 +---- generator/generator_tool/generator_tool.cpp | 1 - indexer/search_string_utils.cpp | 2 -- indexer/transliteration_loader.cpp | 15 ++++++++------- map/framework.cpp | 2 +- 5 files changed, 10 insertions(+), 15 deletions(-) diff --git a/coding/transliteration.cpp b/coding/transliteration.cpp index bb52809333..687174c039 100644 --- a/coding/transliteration.cpp +++ b/coding/transliteration.cpp @@ -118,10 +118,7 @@ bool Transliteration::Transliterate(std::string const & transID, icu::UnicodeStr it->second->m_transliterator->transliterate(ustr); - if (ustr.isEmpty()) - return false; - - return true; + return !ustr.isEmpty(); } bool Transliteration::TransliterateForce(std::string const & str, std::string const & transliteratorId, diff --git a/generator/generator_tool/generator_tool.cpp b/generator/generator_tool/generator_tool.cpp index b3057b0d3e..166ad928e9 100644 --- a/generator/generator_tool/generator_tool.cpp +++ b/generator/generator_tool/generator_tool.cpp @@ -54,7 +54,6 @@ #include "platform/platform.hpp" #include "coding/endianness.hpp" -#include "coding/transliteration.hpp" #include "base/file_name_utils.hpp" #include "base/timer.hpp" diff --git a/indexer/search_string_utils.cpp b/indexer/search_string_utils.cpp index 5813657aa9..ea4826b20f 100644 --- a/indexer/search_string_utils.cpp +++ b/indexer/search_string_utils.cpp @@ -5,8 +5,6 @@ #include "coding/transliteration.hpp" -#include "coding/transliteration.hpp" - #include "base/assert.hpp" #include "base/dfa_helpers.hpp" #include "base/macros.hpp" diff --git a/indexer/transliteration_loader.cpp b/indexer/transliteration_loader.cpp index 5eaec80f87..098bd9106a 100644 --- a/indexer/transliteration_loader.cpp +++ b/indexer/transliteration_loader.cpp @@ -12,23 +12,24 @@ void InitTransliterationInstanceWithDefaultDirs() { + Platform const & pl = GetPlatform(); + #if defined(OMIM_OS_ANDROID) char const kICUDataFile[] = "icudt70l.dat"; - if (!GetPlatform().IsFileExistsByFullPath(GetPlatform().WritableDir() + kICUDataFile)) + if (!pl.IsFileExistsByFullPath(pl.WritableDir() + kICUDataFile)) { try { - ZipFileReader::UnzipFile(GetPlatform().ResourcesDir(), std::string("assets/") + kICUDataFile, - GetPlatform().WritableDir() + kICUDataFile); + ZipFileReader::UnzipFile(pl.ResourcesDir(), std::string("assets/") + kICUDataFile, + pl.WritableDir() + kICUDataFile); } catch (RootException const & e) { - LOG(LWARNING, - ("Can't get transliteration data file \"", kICUDataFile, "\", reason:", e.Msg())); + LOG(LWARNING, ("Can't get transliteration data file \"", kICUDataFile, "\", reason:", e.Msg())); } } - Transliteration::Instance().Init(GetPlatform().WritableDir()); + Transliteration::Instance().Init(pl.WritableDir()); #else - Transliteration::Instance().Init(GetPlatform().ResourcesDir()); + Transliteration::Instance().Init(pl.ResourcesDir()); #endif } diff --git a/map/framework.cpp b/map/framework.cpp index ee83525f2c..c0c0d9c268 100644 --- a/map/framework.cpp +++ b/map/framework.cpp @@ -412,7 +412,7 @@ Framework::Framework(FrameworkParams const & params) m_featuresFetcher.GetDataSource().AddObserver(editor); - LOG(LINFO, ("Editor initialized")); + LOG(LDEBUG, ("Editor initialized")); m_trafficManager.SetCurrentDataVersion(m_storage.GetCurrentDataVersion()); m_trafficManager.SetSimplifiedColorScheme(LoadTrafficSimplifiedColors());