From d47f52b63f0391eac2acfcd5cd8541c3cc81cf4c Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Thu, 24 Aug 2017 17:12:17 +1000 Subject: [PATCH] geom/aabb: use vector operations for inclusive test --- geom/aabb.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/geom/aabb.cpp b/geom/aabb.cpp index 4b1acb05..dd44c6e8 100644 --- a/geom/aabb.cpp +++ b/geom/aabb.cpp @@ -60,11 +60,7 @@ template bool aabb::inclusive (point p) const { - for (size_t i = 0; i < S; ++i) - if (p0[i] > p[i] || p1[i] < p[i]) - return false; - - return true; + return all (p0 <= p && p1 >= p); }