From f061789d1953ae41fdf87f91ca71da1f9569d1b1 Mon Sep 17 00:00:00 2001 From: wmayer Date: Fri, 17 Jul 2020 13:19:38 +0200 Subject: [PATCH] PVS: V560 A part of conditional expression is always true --- src/Mod/Fem/Gui/TaskFemConstraintDisplacement.cpp | 4 ++-- src/Mod/Fem/Gui/TaskFemConstraintFixed.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Mod/Fem/Gui/TaskFemConstraintDisplacement.cpp b/src/Mod/Fem/Gui/TaskFemConstraintDisplacement.cpp index 0e45d52010..19f9c4f623 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintDisplacement.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraintDisplacement.cpp @@ -445,8 +445,8 @@ void TaskFemConstraintDisplacement::addToSelection() searchStr = "Edge"; else searchStr = "Face"; - for (unsigned int iStr = 0; iStr < (SubElements.size()); ++iStr){ - if ((SubElements[iStr].find(searchStr) == std::string::npos) && (SubElements.size() > 0)){ + for (size_t iStr = 0; iStr < (SubElements.size()); ++iStr){ + if (SubElements[iStr].find(searchStr) == std::string::npos){ QString msg = tr("Only one type of selection (vertex,face or edge) per constraint allowed!"); QMessageBox::warning(this, tr("Selection error"), msg); addMe=false; diff --git a/src/Mod/Fem/Gui/TaskFemConstraintFixed.cpp b/src/Mod/Fem/Gui/TaskFemConstraintFixed.cpp index c4402e1415..e7b38bb73d 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintFixed.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraintFixed.cpp @@ -153,7 +153,7 @@ void TaskFemConstraintFixed::addToSelection() else searchStr = "Face"; for (size_t iStr = 0; iStr < (SubElements.size()); ++iStr){ - if ((SubElements[iStr].find(searchStr) == std::string::npos) && (SubElements.size() > 0)){ + if (SubElements[iStr].find(searchStr) == std::string::npos){ QString msg = tr("Only one type of selection (vertex,face or edge) per constraint allowed!"); QMessageBox::warning(this, tr("Selection error"), msg); addMe = false;