From c11be7f62999feb0d07277df9f816f963cff19ec Mon Sep 17 00:00:00 2001 From: Arthur Petukhovsky Date: Thu, 14 May 2020 14:30:26 +0300 Subject: [PATCH] Remove border checks in single bucket index --- .../Dictionaries/PolygonDictionaryUtils.cpp | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/dbms/src/Dictionaries/PolygonDictionaryUtils.cpp b/dbms/src/Dictionaries/PolygonDictionaryUtils.cpp index ed7d6b6ee99..cab35438ec0 100644 --- a/dbms/src/Dictionaries/PolygonDictionaryUtils.cpp +++ b/dbms/src/Dictionaries/PolygonDictionaryUtils.cpp @@ -387,11 +387,10 @@ 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()); - if (edge_y > y) + if (edge_y <= y) { - continue; + intersections.emplace_back(polygon_id); } - intersections.emplace_back(polygon_id); } pos >>= 1; } while (pos != 0); @@ -620,10 +619,6 @@ bool BucketsSinglePolygonIndex::find(const Point & point) const /** check for vertical edge, seem like never happens */ if (l.x() == r.x()) { - if (l.x() == x && y >= l.y() && y <= r.y()) - { - return true; - } continue; } @@ -634,16 +629,10 @@ bool BucketsSinglePolygonIndex::find(const Point & point) const } 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; + ++cnt; } - if (edge_y == y) - { - return true; - } - - ++cnt; } pos >>= 1; } while (pos != 0);