From 39c1be6bc0fcce383e0892e7d656b67c0a373fd1 Mon Sep 17 00:00:00 2001 From: "andrey.bychkov" Date: Wed, 18 Feb 2026 20:03:27 +0300 Subject: [PATCH] fix filterElements --- libs/main/containers/pivector2d.h | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/libs/main/containers/pivector2d.h b/libs/main/containers/pivector2d.h index 895f7293..537ded76 100644 --- a/libs/main/containers/pivector2d.h +++ b/libs/main/containers/pivector2d.h @@ -1668,16 +1668,12 @@ public: return result; } - //! \~english Returns a new 2D array (as a single row) containing only the elements that pass the test. - //! \~russian Возвращает новый двумерный массив (в виде одной строки), содержащий только элементы, прошедшие проверку. + //! \~english Returns a new plain array containing only the elements that pass the test. + //! \~russian Возвращает новый одноменый массив, содержащий только элементы, прошедшие проверку. //! \param test Predicate taking a const T&. - //! \return A 1xN 2D array with the filtered elements (or empty). + //! \return PIVector with the filtered elements (or empty). //! \sa PIVector::filter() - inline PIVector2D filterElements(std::function test) const { - PIVector filtered = mat.filter(test); - if (filtered.isEmpty()) return PIVector2D(); - return PIVector2D(1, filtered.size(), filtered); - } + inline PIVector filterElements(std::function test) const { return mat.filter(test); } protected: size_t rows_, cols_;