Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvng <viktor.govako@gmail.com>2016-02-18 17:37:51 +0300
committerSergey Yershov <yershov@corp.mail.ru>2016-03-23 16:21:26 +0300
commitef773229e2da03044e497234ab4a53f6ed1dcc13 (patch)
tree8c335a583657e6d348df1934eb0b0c5aa5572c1a /indexer/rank_table.cpp
parent0cff2e4e4c1416021924a9624f4fcb3a354a0007 (diff)
Factor out Rank <-> Population functions.
Diffstat (limited to 'indexer/rank_table.cpp')
-rw-r--r--indexer/rank_table.cpp16
1 files changed, 3 insertions, 13 deletions
diff --git a/indexer/rank_table.cpp b/indexer/rank_table.cpp
index c83ba77281..d7bdd48fab 100644
--- a/indexer/rank_table.cpp
+++ b/indexer/rank_table.cpp
@@ -2,9 +2,10 @@
#include "indexer/data_header.hpp"
#include "indexer/feature_algo.hpp"
+#include "indexer/feature_impl.hpp"
#include "indexer/feature_utils.hpp"
#include "indexer/features_vector.hpp"
-#include "indexer/types_skipper.hpp"
+#include "indexer/ftypes_matcher.hpp"
#include "platform/local_country_file.hpp"
#include "platform/local_country_file_utils.hpp"
@@ -246,18 +247,7 @@ unique_ptr<RankTable> LoadRankTable(unique_ptr<TRegion> && region)
// Calculates search rank for a feature.
uint8_t CalcSearchRank(FeatureType const & ft)
{
- static search::TypesSkipper skipIndex;
-
- feature::TypesHolder types(ft);
- skipIndex.SkipTypes(types);
- if (types.Empty())
- return 0;
-
- // Rank (and population) is used for point features only at this moment.
- if (ft.GetFeatureType() == feature::GEOM_POINT)
- return feature::GetSearchRank(types, ft.GetCenter(), ft.GetPopulation());
- else
- return 0;
+ return feature::PopulationToRank(ftypes::GetPopulation(ft));
}
// Creates rank table if it does not exists in |rcont| or has wrong