From a39175e9b765b8a9a5e5df16d93cec08b6d14d4f Mon Sep 17 00:00:00 2001 From: Kirill Zhdanovich Date: Mon, 24 Mar 2014 18:31:33 +0300 Subject: [PATCH] [search] change string to char const * for affics --- search/house_detector.cpp | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/search/house_detector.cpp b/search/house_detector.cpp index 6a8dc365bd..f5820a84ff 100644 --- a/search/house_detector.cpp +++ b/search/house_detector.cpp @@ -98,7 +98,7 @@ public: /// @todo Move prefixes, suffixes into separate file (autogenerated). /// "Набережная" улица встречается в городах -string affics[] = +char const * affics[] = { // Russian "аллея", "бульвар", "набережная", "переулок", "площадь", "проезд", "проспект", "шоссе", "тупик", "улица", "тракт", "ал", "бул", "наб", "пер", "пл", "пр", "просп", "ш", "туп", "ул", "тр", @@ -175,17 +175,9 @@ void GetStreetName(strings::SimpleTokenizer iter, string & streetName) string const s = strings::MakeLowerCase(*iter); ++iter; - bool flag = true; - for (size_t i = 0; i < ARRAY_SIZE(affics); ++i) - { - if (s == affics[i]) - { - flag = false; - break; - } - } + char const ** end = affics + ARRAY_SIZE(affics); - if (flag) + if (find(affics, end, s) == end) streetName += s; } }