[search] Fixed wrong units in a call to IsEqualMercator.

SearchAPITest_MultipleViewportsRequests waited indefinitely
on a future-promise because of a wrong eps in IsEqualMercator.
This commit is contained in:
Maxim Pimenov 2018-11-28 15:33:48 +03:00 committed by Tatiana Yan
parent 335c44894c
commit 0e3c861315

View file

@ -34,6 +34,7 @@ namespace
using BookmarkIdDoc = pair<bookmarks::Id, bookmarks::Doc>;
double const kDistEqualQueryMeters = 100.0;
double const kDistEqualQueryMercator = MercatorBounds::MetersToMercator(kDistEqualQueryMeters);
// Cancels search query by |handle|.
void CancelQuery(weak_ptr<ProcessorHandle> & handle)
@ -407,14 +408,14 @@ bool SearchAPI::QueryMayBeSkipped(SearchParams const & prevParams,
return false;
if (!prevViewport.IsValid() ||
!IsEqualMercator(prevViewport, currViewport, kDistEqualQueryMeters))
!IsEqualMercator(prevViewport, currViewport, kDistEqualQueryMercator))
{
return false;
}
if (prevParams.m_position && currParams.m_position &&
MercatorBounds::DistanceOnEarth(*prevParams.m_position, *currParams.m_position) >
kDistEqualQueryMeters)
kDistEqualQueryMercator)
{
return false;
}