From c7d258558dab5ddc58e48f2a84d4e99522c906ca Mon Sep 17 00:00:00 2001 From: Anatoly Serdtcev Date: Thu, 27 Dec 2018 16:41:18 +0300 Subject: [PATCH] [indexer] Fix for review --- indexer/cell_coverer.hpp | 4 ++-- indexer/feature_covering.hpp | 4 ++-- 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 -inline void CoverRectByCells(m2::RectD rect, size_t cellsCount, int maxLevel, std::vector & result) +inline void CoverRect(m2::RectD rect, size_t cellsCount, int maxLevel, std::vector & 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 -void CoverSpiralByCells(m2::RectD rect, int maxLevel, std::vector & result) +void CoverSpiral(m2::RectD rect, int maxLevel, std::vector & result) { using Converter = CellIdConverter; 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> ids; ids.reserve(SPLIT_RECT_CELLS_COUNT); - CoverRectByCells>(r, SPLIT_RECT_CELLS_COUNT, cellDepth - 1, ids); + CoverRect>(r, SPLIT_RECT_CELLS_COUNT, cellDepth - 1, ids); Intervals intervals; for (auto const & id : ids) @@ -153,7 +153,7 @@ public: case Spiral: { std::vector> ids; - CoverSpiralByCells>(m_rect, cellDepth - 1, ids); + CoverSpiral>(m_rect, cellDepth - 1, ids); std::set 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 cells; - CoverRectByCells({27.43, 53.83, 27.70, 53.96}, 4, RectId::DEPTH_LEVELS - 1, cells); + CoverRect({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 cells; - CoverRectByCells({5, 5, 11, 11}, 4, RectId::DEPTH_LEVELS - 1, cells); + CoverRect({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>{}; - CoverSpiralByCells>({2.1, 4.1, 2.1, 4.1}, levelMax, cells); + CoverSpiral>({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, ()); } }