remove some unnecessary Boolean checks

- checks for true/false and nullptr
This commit is contained in:
Uwe
2022-12-12 03:12:43 +01:00
committed by Chris Hennes
parent 0e062212b5
commit 0533550f95
6 changed files with 11 additions and 13 deletions

View File

@@ -169,7 +169,7 @@ App::DocumentObjectExecReturn *FeatureViewSpreadsheet::execute(void)
// get the text
App::Property* prop = sheet->getPropertyByName(address.toString().c_str());
std::stringstream field;
if (prop != nullptr) {
if (prop) {
if (prop->isDerivedFrom((App::PropertyQuantity::getClassTypeId())))
field << static_cast<App::PropertyQuantity*>(prop)->getValue();
else if (prop->isDerivedFrom((App::PropertyFloat::getClassTypeId())))

View File

@@ -172,7 +172,6 @@ QVector<QString> buildBOPCheckResultVector()
return results;
}
QString getBOPCheckString(const BOPAlgo_CheckStatus &status)
{
static QVector<QString> strings = buildBOPCheckResultVector();
@@ -182,7 +181,6 @@ QString getBOPCheckString(const BOPAlgo_CheckStatus &status)
return strings.at(index);
}
ResultEntry::ResultEntry()
{
viewProviderRoot = nullptr;
@@ -204,9 +202,9 @@ ResultEntry::~ResultEntry()
void ResultEntry::buildEntryName()
{
ResultEntry *parentEntry = this;
while (parentEntry->parent != nullptr) {
ResultEntry *temp = parentEntry->parent;
ResultEntry* parentEntry = this;
while (parentEntry->parent) {
ResultEntry* temp = parentEntry->parent;
if (!temp->parent)
break;
parentEntry = parentEntry->parent;

View File

@@ -967,7 +967,7 @@ void TaskSketcherConstraints::on_showHideButton_clicked(bool val)
bool allSelected = true;
for (int i = 0; i < ui->listWidgetConstraints->count(); ++i){
QListWidgetItem* it = ui->listWidgetConstraints->item(i);
if (it->isHidden() == false && it->checkState() == Qt::Unchecked) {
if (!(it->isHidden()) && it->checkState() == Qt::Unchecked) {
allSelected = false;
break;
}