From 8c1d3b3724e0edad9e43fa934d23c2217ab412ef Mon Sep 17 00:00:00 2001 From: Niklas Fehn Date: Fri, 8 Apr 2022 16:08:39 +0200 Subject: [PATCH] now implement correct version --- source/base/mpi_remote_point_evaluation.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/source/base/mpi_remote_point_evaluation.cc b/source/base/mpi_remote_point_evaluation.cc index 4af01fa5cc..dd1907609a 100644 --- a/source/base/mpi_remote_point_evaluation.cc +++ b/source/base/mpi_remote_point_evaluation.cc @@ -192,9 +192,10 @@ namespace Utilities if (is_map_unique()) return true; - for (unsigned int i = 1; i < point_ptrs.size(); ++i) - if (point_found(i) == false) - return false; + if (point_ptrs.size() > 0) + for (unsigned int i = 0; i < point_ptrs.size() - 1; ++i) + if (point_found(i) == false) + return false; return true; } @@ -206,8 +207,8 @@ namespace Utilities RemotePointEvaluation::point_found( const unsigned int i) const { - AssertIndexRange(i, point_ptrs.size()); - return (point_ptrs[i] - (i > 0) ? point_ptrs[i - 1] : 0) > 0; + AssertIndexRange(i, point_ptrs.size() - 1); + return (point_ptrs[i + 1] - point_ptrs[i]) > 0; } -- 2.39.5