save intermediary result to avoid computing it up to 3 times in Less_along_2_axis

This commit is contained in:
Maxime Gimeno 2021-03-10 13:33:01 +01:00
parent d2ba62aa21
commit 7f334a0133
1 changed files with 3 additions and 2 deletions

View File

@ -279,8 +279,9 @@ public:
typedef bool result_type;
bool operator() (const Point &p, const Point &q) const {
return base1 * (p - q) < 0
|| base1 * (p - q) == 0 && base2 * (p - q) < 0;
auto proj = base1 * (p - q);
return proj < 0
|| proj == 0 && proj < 0;
}
}; // end class Less_along_axis