From e8cc2081d1d651feaf57897ef8ce9c9b850d0ec8 Mon Sep 17 00:00:00 2001 From: Anatoly Serdtcev Date: Thu, 24 Jan 2019 12:54:03 +0300 Subject: [PATCH] [indexer] Fix distance weight --- indexer/locality_index.hpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/indexer/locality_index.hpp b/indexer/locality_index.hpp index dc712bcca4..94ab4380bf 100644 --- a/indexer/locality_index.hpp +++ b/indexer/locality_index.hpp @@ -100,12 +100,10 @@ public: return 1.0; auto const cell = m2::CellId::FromInt64(cellNumber, cellDepth); - auto const distance = chebyshevDistance(cell.XY()); - auto const cellSize = 2 * cell.Radius(); - auto const roudDistance = (distance + cellSize - 1) / cellSize * cellSize; - CHECK_GREATER(roudDistance, 1, ()); + auto const distance = chebyshevDistance(cell.XY()) - cell.Radius(); + CHECK_GREATER(distance, 0, ()); - return 1.0 / roudDistance; + return 1.0 / distance; }; auto insertObject = [&] (int64_t cellNumber, uint64_t storedId) {