PVS: V560 A part of conditional expression is always true

This commit is contained in:
wmayer
2020-07-17 13:19:38 +02:00
parent 73cc1d271f
commit f061789d19
2 changed files with 3 additions and 3 deletions

View File

@@ -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;

View File

@@ -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;