diff options
author | Anatoly Serdtcev <serdtcev@maps.me> | 2019-01-15 19:02:22 +0300 |
---|---|---|
committer | Sergey Yershov <syershov@maps.me> | 2019-01-31 14:04:45 +0300 |
commit | 89665ff81af43ce7e4a5433ebfab1d53df2f8e23 (patch) | |
tree | 52796ead7d097660ce034414261e3948a5623e6a /indexer | |
parent | dee7e97a9f521f5b2c2bb37b9241ee93d3af26b4 (diff) |
[indexer] Fix for review
Diffstat (limited to 'indexer')
-rw-r--r-- | indexer/interval_index.hpp | 14 | ||||
-rw-r--r-- | indexer/locality_index.hpp | 4 |
2 files changed, 10 insertions, 8 deletions
diff --git a/indexer/interval_index.hpp b/indexer/interval_index.hpp index c418208190..d219e6aeaf 100644 --- a/indexer/interval_index.hpp +++ b/indexer/interval_index.hpp @@ -67,14 +67,15 @@ public: --end; // end is inclusive in ForEachImpl(). ForEachNode(f, beg, end, m_Header.m_Levels, 0, m_LevelOffsets[m_Header.m_Levels + 1] - m_LevelOffsets[m_Header.m_Levels], - 0 /* started nodeKey */); + 0 /* started keyBase */); } } private: template <typename F> void ForEachLeaf(F const & f, uint64_t const beg, uint64_t const end, - uint32_t const offset, uint32_t const size, uint64_t keyBase) const + uint32_t const offset, uint32_t const size, + uint64_t keyBase /* discarded part of object key value in the parent nodes*/) const { buffer_vector<uint8_t, 1024> data; data.resize_no_init(size); @@ -99,13 +100,14 @@ private: template <typename F> void ForEachNode(F const & f, uint64_t beg, uint64_t end, int level, - uint32_t offset, uint32_t size, uint64_t nodeKey) const + uint32_t offset, uint32_t size, + uint64_t keyBase /* discarded part of object key value in the parent nodes */) const { offset += m_LevelOffsets[level]; if (level == 0) { - ForEachLeaf(f, beg, end, offset, size, nodeKey); + ForEachLeaf(f, beg, end, offset, size, keyBase); return; } @@ -139,7 +141,7 @@ private: { uint64_t const beg1 = (i == beg0) ? (beg & levelBytesFF) : 0; uint64_t const end1 = (i == end0) ? (end & levelBytesFF) : levelBytesFF; - ForEachNode(f, beg1, end1, level - 1, childOffset, childSize, nodeKey + (uint64_t{i} << skipBits)); + ForEachNode(f, beg1, end1, level - 1, childOffset, childSize, keyBase + (uint64_t{i} << skipBits)); } childOffset += childSize; } @@ -161,7 +163,7 @@ private: { uint64_t const beg1 = (i == beg0) ? (beg & levelBytesFF) : 0; uint64_t const end1 = (i == end0) ? (end & levelBytesFF) : levelBytesFF; - ForEachNode(f, beg1, end1, level - 1, childOffset, childSize, nodeKey + (uint64_t{i} << skipBits)); + ForEachNode(f, beg1, end1, level - 1, childOffset, childSize, keyBase + (uint64_t{i} << skipBits)); } childOffset += childSize; } diff --git a/indexer/locality_index.hpp b/indexer/locality_index.hpp index 69e3843f83..e4252a91f8 100644 --- a/indexer/locality_index.hpp +++ b/indexer/locality_index.hpp @@ -31,7 +31,7 @@ class LocalityIndex { public: using ProcessObject = std::function<void(base::GeoObjectId const &)>; - using ProcessClosestObject = std::function<void(base::GeoObjectId const & objectId, double closenessWeight)>; + using ProcessCloseObject = std::function<void(base::GeoObjectId const & objectId, double closenessWeight)>; LocalityIndex() = default; explicit LocalityIndex(Reader const & reader) @@ -63,7 +63,7 @@ public: // thus probably overflowing the |sizeHint| limit. // |processObject| gets object id in the first argument |objectId| and closeness weight // in the seŃond argument |closenessWeight| (closeness weight in the range (0.0, 1.0]). - void ForClosestToPoint(ProcessClosestObject const & processObject, m2::PointD const & center, + void ForClosestToPoint(ProcessCloseObject const & processObject, m2::PointD const & center, double radiusM, uint32_t sizeHint) const { auto const rect = |