mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-27 20:20:49 +00:00
Remove border checks in single bucket index
This commit is contained in:
parent
cb766225ee
commit
c11be7f629
@ -387,12 +387,11 @@ bool BucketsPolygonIndex::find(const Point & point, size_t & id) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
Coord edge_y = l.y() + (r.y() - l.y()) / (r.x() - l.x()) * (x - l.x());
|
Coord edge_y = l.y() + (r.y() - l.y()) / (r.x() - l.x()) * (x - l.x());
|
||||||
if (edge_y > y)
|
if (edge_y <= y)
|
||||||
{
|
{
|
||||||
continue;
|
|
||||||
}
|
|
||||||
intersections.emplace_back(polygon_id);
|
intersections.emplace_back(polygon_id);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
pos >>= 1;
|
pos >>= 1;
|
||||||
} while (pos != 0);
|
} while (pos != 0);
|
||||||
|
|
||||||
@ -620,10 +619,6 @@ bool BucketsSinglePolygonIndex::find(const Point & point) const
|
|||||||
/** check for vertical edge, seem like never happens */
|
/** check for vertical edge, seem like never happens */
|
||||||
if (l.x() == r.x())
|
if (l.x() == r.x())
|
||||||
{
|
{
|
||||||
if (l.x() == x && y >= l.y() && y <= r.y())
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -634,17 +629,11 @@ bool BucketsSinglePolygonIndex::find(const Point & point) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
Coord edge_y = l.y() + (r.y() - l.y()) / (r.x() - l.x()) * (x - l.x());
|
Coord edge_y = l.y() + (r.y() - l.y()) / (r.x() - l.x()) * (x - l.x());
|
||||||
if (edge_y > y)
|
if (edge_y <= y)
|
||||||
{
|
{
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (edge_y == y)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
++cnt;
|
++cnt;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
pos >>= 1;
|
pos >>= 1;
|
||||||
} while (pos != 0);
|
} while (pos != 0);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user