diff options
-rw-r--r-- | platform/get_text_by_id.hpp | 2 | ||||
-rw-r--r-- | routing/turns_tts_text.cpp | 15 | ||||
-rw-r--r-- | routing/turns_tts_text.hpp | 1 |
3 files changed, 10 insertions, 8 deletions
diff --git a/platform/get_text_by_id.hpp b/platform/get_text_by_id.hpp index 45c8fdb5e5..7d1c5cac50 100644 --- a/platform/get_text_by_id.hpp +++ b/platform/get_text_by_id.hpp @@ -20,7 +20,7 @@ class GetTextById public: GetTextById(TextSource textSouce, string const & localeName); /// The constructor is used for writing unit tests only. - GetTextById(string const & jsonBuffer); + explicit GetTextById(string const & jsonBuffer); bool IsValid() const { return !m_localeTexts.empty(); } /// @return a pair of a text string in a specified locale for textId and a boolean flag. diff --git a/routing/turns_tts_text.cpp b/routing/turns_tts_text.cpp index ecfae482bf..69292a2dfe 100644 --- a/routing/turns_tts_text.cpp +++ b/routing/turns_tts_text.cpp @@ -8,14 +8,15 @@ namespace { using namespace routing::turns::sound; -string DistToTextId(VecPairDist::const_iterator begin, VecPairDist::const_iterator end, - uint32_t dist) + +template <class TIter> string DistToTextId(TIter begin, TIter end, uint32_t dist) { - VecPairDist::const_iterator distToSound = - lower_bound(begin, end, dist, [](PairDist const & p1, uint32_t p2) - { - return p1.first < p2; - }); + using TValue = typename iterator_traits<TIter>::value_type; + + TIter distToSound = lower_bound(begin, end, dist, [](TValue const & p1, uint32_t p2) + { + return p1.first < p2; + }); if (distToSound == end) { ASSERT(false, ("notification.m_distanceUnits is not correct.")); diff --git a/routing/turns_tts_text.hpp b/routing/turns_tts_text.hpp index 48666cd090..e7e29af89a 100644 --- a/routing/turns_tts_text.hpp +++ b/routing/turns_tts_text.hpp @@ -5,6 +5,7 @@ #include "std/string.hpp" #include "std/unique_ptr.hpp" + namespace routing { namespace turns |