From: eap Date: Fri, 22 Nov 2013 12:34:45 +0000 (+0000) Subject: 22361: EDF SMESH: Quadrangle (mapping) algorithm: faces with more than 4 edges X-Git-Tag: V7_3_0a1~29 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0280d2e6a7e4bc637f847f7529b775941d429b38;p=modules%2Fsmesh.git 22361: EDF SMESH: Quadrangle (mapping) algorithm: faces with more than 4 edges Fix "int WrapIndex(const int ind, const int nbNodes)" for ind=-4 and nbNodes=4 --- diff --git a/src/SMESH/SMESH_MesherHelper.hxx b/src/SMESH/SMESH_MesherHelper.hxx index 0073e0881..bfe44f75a 100644 --- a/src/SMESH/SMESH_MesherHelper.hxx +++ b/src/SMESH/SMESH_MesherHelper.hxx @@ -140,10 +140,8 @@ class SMESH_EXPORT SMESH_MesherHelper * \param nbNodes - total nb of nodes * \retval int - valid node index */ - static int WrapIndex(const int ind, const int nbNodes) { - if ( ind < 0 ) return nbNodes + ind % nbNodes; - if ( ind >= nbNodes ) return ind % nbNodes; - return ind; + static inline int WrapIndex(int ind, const int nbNodes) { + return (( ind %= nbNodes ) < 0 ) ? ind + nbNodes : ind; } /*!