diff options
author | Anatoly Serdtcev <serdtcev@maps.me> | 2018-12-27 16:41:18 +0300 |
---|---|---|
committer | mpimenov <mpimenov@users.noreply.github.com> | 2019-01-23 12:38:58 +0300 |
commit | c7d258558dab5ddc58e48f2a84d4e99522c906ca (patch) | |
tree | cdddae422f27abbfc4b8fb5a2a49e938d5a0a851 /indexer | |
parent | 50b66e6985ad6956eea6b5f3d3f46a0d0bc1b8a3 (diff) |
[indexer] Fix for review
Diffstat (limited to 'indexer')
-rw-r--r-- | indexer/cell_coverer.hpp | 4 | ||||
-rw-r--r-- | indexer/feature_covering.hpp | 4 | ||||
-rw-r--r-- | indexer/indexer_tests/cell_coverer_test.cpp | 14 |
3 files changed, 11 insertions, 11 deletions
diff --git a/indexer/cell_coverer.hpp b/indexer/cell_coverer.hpp index 165dbe179a..9b698a83ae 100644 --- a/indexer/cell_coverer.hpp +++ b/indexer/cell_coverer.hpp @@ -36,7 +36,7 @@ inline size_t SplitRectCell(CellId const & id, m2::RectD const & rect, // Covers |rect| with at most |cellsCount| cells that have levels equal to or less than |maxLevel|. template <typename Bounds, typename CellId> -inline void CoverRectByCells(m2::RectD rect, size_t cellsCount, int maxLevel, std::vector<CellId> & result) +inline void CoverRect(m2::RectD rect, size_t cellsCount, int maxLevel, std::vector<CellId> & result) { ASSERT(result.empty(), ()); { @@ -105,7 +105,7 @@ inline void CoverRectByCells(m2::RectD rect, size_t cellsCount, int maxLevel, st // Covers |rect| with cells using spiral order starting from the rect center cell of |maxLevel|. template <typename Bounds, typename CellId> -void CoverSpiralByCells(m2::RectD rect, int maxLevel, std::vector<CellId> & result) +void CoverSpiral(m2::RectD rect, int maxLevel, std::vector<CellId> & result) { using Converter = CellIdConverter<Bounds, CellId>; diff --git a/indexer/feature_covering.hpp b/indexer/feature_covering.hpp index 1a12025ddf..24e6efa0c9 100644 --- a/indexer/feature_covering.hpp +++ b/indexer/feature_covering.hpp @@ -78,7 +78,7 @@ void CoverViewportAndAppendLowerLevels(m2::RectD const & r, int cellDepth, Inter { std::vector<m2::CellId<DEPTH_LEVELS>> ids; ids.reserve(SPLIT_RECT_CELLS_COUNT); - CoverRectByCells<MercatorBounds, m2::CellId<DEPTH_LEVELS>>(r, SPLIT_RECT_CELLS_COUNT, cellDepth - 1, ids); + CoverRect<MercatorBounds, m2::CellId<DEPTH_LEVELS>>(r, SPLIT_RECT_CELLS_COUNT, cellDepth - 1, ids); Intervals intervals; for (auto const & id : ids) @@ -153,7 +153,7 @@ public: case Spiral: { std::vector<m2::CellId<DEPTH_LEVELS>> ids; - CoverSpiralByCells<MercatorBounds, m2::CellId<DEPTH_LEVELS>>(m_rect, cellDepth - 1, ids); + CoverSpiral<MercatorBounds, m2::CellId<DEPTH_LEVELS>>(m_rect, cellDepth - 1, ids); std::set<Interval> uniqueIds; auto insertInterval = [this, ind, &uniqueIds](Interval const & interval) { diff --git a/indexer/indexer_tests/cell_coverer_test.cpp b/indexer/indexer_tests/cell_coverer_test.cpp index 307c7d5270..89fff949a9 100644 --- a/indexer/indexer_tests/cell_coverer_test.cpp +++ b/indexer/indexer_tests/cell_coverer_test.cpp @@ -18,10 +18,10 @@ UNIT_TEST(CellIdToStringRecode) TEST_EQUAL(CellIdT::FromString(kTest).ToString(), kTest, ()); } -UNIT_TEST(GoldenCoverRectByCells) +UNIT_TEST(GoldenCoverRect) { vector<CellIdT> cells; - CoverRectByCells<OrthoBounds>({27.43, 53.83, 27.70, 53.96}, 4, RectId::DEPTH_LEVELS - 1, cells); + CoverRect<OrthoBounds>({27.43, 53.83, 27.70, 53.96}, 4, RectId::DEPTH_LEVELS - 1, cells); TEST_EQUAL(cells.size(), 4, ()); @@ -31,12 +31,12 @@ UNIT_TEST(GoldenCoverRectByCells) TEST_EQUAL(cells[3].ToString(), "32012211303", ()); } -UNIT_TEST(ArtificialCoverRectByCells) +UNIT_TEST(ArtificialCoverRect) { typedef Bounds<0, 0, 16, 16> TestBounds; vector<CellIdT> cells; - CoverRectByCells<TestBounds>({5, 5, 11, 11}, 4, RectId::DEPTH_LEVELS - 1, cells); + CoverRect<TestBounds>({5, 5, 11, 11}, 4, RectId::DEPTH_LEVELS - 1, cells); TEST_EQUAL(cells.size(), 4, ()); @@ -46,7 +46,7 @@ UNIT_TEST(ArtificialCoverRectByCells) TEST_EQUAL(cells[3].ToString(), "30", ()); } -UNIT_TEST(MaxDepthCoverSpiralByCells) +UNIT_TEST(MaxDepthCoverSpiral) { using TestBounds = Bounds<0, 0, 8, 8>; @@ -54,9 +54,9 @@ UNIT_TEST(MaxDepthCoverSpiralByCells) { auto cells = vector<m2::CellId<3>>{}; - CoverSpiralByCells<TestBounds, m2::CellId<3>>({2.1, 4.1, 2.1, 4.1}, levelMax, cells); + CoverSpiral<TestBounds, m2::CellId<3>>({2.1, 4.1, 2.1, 4.1}, levelMax, cells); TEST_EQUAL(cells.size(), 1, ()); - TEST_EQUAL(cells[0].Level(), depthMax - 1, ()); + TEST_EQUAL(cells[0].Level(), levelMax - 1, ()); } } |