[search] Remove trie::GetGeometryCodingParams.

This commit is contained in:
tatiana-yan 2019-09-03 18:44:26 +03:00 committed by mpimenov
parent a167843f73
commit c645d18377
5 changed files with 3 additions and 23 deletions

View file

@ -199,11 +199,9 @@ namespace feature
FilesContainerR container(make_unique<FileReader>(fPath));
feature::DataHeader header(container);
serial::GeometryCodingParams codingParams(
trie::GetGeometryCodingParams(header.GetDefGeometryCodingParams()));
auto const trieRoot = trie::ReadTrie<ModelReaderPtr, ValueList<TValue>>(
container.GetReader(SEARCH_INDEX_FILE_TAG), SingleValueSerializer<TValue>(codingParams));
container.GetReader(SEARCH_INDEX_FILE_TAG), SingleValueSerializer<TValue>());
SearchTokensCollector<TValue> f;
trie::ForEachRef(*trieRoot, f, strings::UniString());

View file

@ -583,9 +583,7 @@ void BuildSearchIndex(FilesContainerR & container, Writer & indexWriter)
auto const & categoriesHolder = GetDefaultCategories();
FeaturesVectorTest features(container);
auto codingParams =
trie::GetGeometryCodingParams(features.GetHeader().GetDefGeometryCodingParams());
SingleValueSerializer<Value> serializer(codingParams);
SingleValueSerializer<Value> serializer;
vector<pair<Key, Value>> searchIndexKeyValuePairs;
AddFeatureNameIndexPairs(features, categoriesHolder, searchIndexKeyValuePairs);

View file

@ -339,10 +339,8 @@ struct RetrievePostcodeFeaturesAdaptor
template <typename Value>
unique_ptr<Retrieval::TrieRoot<Value>> ReadTrie(MwmValue & value, ModelReaderPtr & reader)
{
serial::GeometryCodingParams params(
trie::GetGeometryCodingParams(value.GetHeader().GetDefGeometryCodingParams()));
return trie::ReadTrie<SubReaderWrapper<Reader>, ValueList<Value>>(
SubReaderWrapper<Reader>(reader.GetPtr()), SingleValueSerializer<Value>(params));
SubReaderWrapper<Reader>(reader.GetPtr()), SingleValueSerializer<Value>());
}
} // namespace

View file

@ -61,9 +61,6 @@ public:
SingleValueSerializer() = default;
// todo(@mpimenov). Remove.
SingleValueSerializer(serial::GeometryCodingParams const & /* codingParams */) {}
// The serialization and deserialization is needed for StringsFile.
// Use ValueList for group serialization in CBVs.
template <typename Sink>

View file

@ -9,15 +9,4 @@ namespace search
{
static const uint8_t kCategoriesLang = 128;
static const uint8_t kPostcodesLang = 129;
static const uint8_t kPointCodingBits = 20;
} // namespace search
namespace trie
{
inline serial::GeometryCodingParams GetGeometryCodingParams(
serial::GeometryCodingParams const & orig)
{
return serial::GeometryCodingParams(search::kPointCodingBits,
PointUToPointD(orig.GetBasePoint(), orig.GetCoordBits()));
}
} // namespace trie