[App] remove unnecessary Boolean comparisons
This commit is contained in:
@@ -317,7 +317,7 @@ PyObject* Application::sCloseDocument(PyObject * /*self*/, PyObject *args)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (GetApplication().closeDocument(pstr) == false) {
|
||||
if (!GetApplication().closeDocument(pstr)) {
|
||||
PyErr_Format(PyExc_RuntimeError, "Closing the document '%s' failed", pstr);
|
||||
return nullptr;
|
||||
}
|
||||
@@ -333,7 +333,7 @@ PyObject* Application::sSaveDocument(PyObject * /*self*/, PyObject *args)
|
||||
|
||||
Document* doc = GetApplication().getDocument(pDoc);
|
||||
if ( doc ) {
|
||||
if ( doc->save() == false ) {
|
||||
if (!doc->save()) {
|
||||
PyErr_Format(Base::PyExc_FC_GeneralError, "Cannot save document '%s'", pDoc);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -2402,7 +2402,7 @@ private:
|
||||
fn = str.str();
|
||||
}
|
||||
|
||||
if (fi.renameFile(fn.c_str()) == false)
|
||||
if (!fi.renameFile(fn.c_str()))
|
||||
Base::Console().Warning("Cannot rename project file to backup file\n");
|
||||
}
|
||||
else {
|
||||
@@ -2411,7 +2411,7 @@ private:
|
||||
}
|
||||
|
||||
Base::FileInfo tmp(sourcename);
|
||||
if (tmp.renameFile(targetname.c_str()) == false) {
|
||||
if (!tmp.renameFile(targetname.c_str())) {
|
||||
throw Base::FileException(
|
||||
"Cannot rename tmp save file to project file", targetname);
|
||||
}
|
||||
@@ -2511,7 +2511,7 @@ private:
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (renameFileNoErase(fi, fn+".FCBak") == false) {
|
||||
if (!renameFileNoErase(fi, fn+".FCBak")) {
|
||||
fn = fn + "-";
|
||||
}
|
||||
else {
|
||||
@@ -2555,7 +2555,7 @@ private:
|
||||
}
|
||||
|
||||
Base::FileInfo tmp(sourcename);
|
||||
if (tmp.renameFile(targetname.c_str()) == false) {
|
||||
if (!tmp.renameFile(targetname.c_str())) {
|
||||
throw Base::FileException(
|
||||
"Save interrupted: Cannot rename temporary file to project file", tmp);
|
||||
}
|
||||
|
||||
@@ -458,7 +458,7 @@ bool Metadata::satisfies(const Meta::Dependency& dep)
|
||||
}
|
||||
auto parsedExpression = App::Expression::parse(nullptr, dep.condition);
|
||||
auto result = parsedExpression->eval();
|
||||
if (boost::any_cast<bool> (result->getValueAsAny()) == false)
|
||||
if (!boost::any_cast<bool> (result->getValueAsAny()))
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user