[Base] remove some more superfluous nullptr checks

This commit is contained in:
Uwe
2022-07-18 13:07:16 +02:00
parent 32ffcc7eda
commit 61303b0a01
5 changed files with 6 additions and 6 deletions

View File

@@ -42,7 +42,7 @@ Range::Range(const char * range, bool normalize)
std::string from;
std::string to;
assert(range != nullptr);
assert(range);
if (!strchr(range, ':')) {
from = range;
@@ -221,7 +221,7 @@ int App::validColumn(const std::string &colstr)
App::CellAddress App::stringToAddress(const char * strAddress, bool silent)
{
assert(strAddress != nullptr);
assert(strAddress);
static boost::regex e("(\\$?[A-Z]{1,2})(\\$?[0-9]{1,5})");
boost::cmatch cm;

View File

@@ -344,7 +344,7 @@ PyObject * FileException::getPyObject()
void FileException::setPyObject( PyObject * pydict)
{
if (pydict!=nullptr) {
if (pydict) {
Exception::setPyObject(pydict);
Py::Dict edict(pydict);

View File

@@ -106,7 +106,7 @@ void PyException::ThrowException()
void PyException::raiseException() {
PyGILStateLocker locker;
if (PP_PyDict_Object!=nullptr) {
if (PP_PyDict_Object) {
// delete the Python dict upon destruction of edict
Py::Dict edict(PP_PyDict_Object, true);
PP_PyDict_Object = nullptr;

View File

@@ -700,7 +700,7 @@ std::string ParameterGrp::GetASCII(const char* Name, const char * pPreset) const
DOMElement *pcElem = FindElement(_pGroupNode,"FCText",Name);
// if not return preset
if (!pcElem) {
if (pPreset==nullptr)
if (!pPreset)
return std::string("");
else
return std::string(pPreset);

View File

@@ -353,7 +353,7 @@ int PyObjectBase::__setattro(PyObject *obj, PyObject *attro, PyObject *value)
//Hint: In general we don't allow to delete attributes (i.e. value=0). However, if we want to allow
//we must check then in _setattr() of all subclasses whether value is 0.
if ( value==nullptr ) {
if (!value) {
PyErr_Format(PyExc_AttributeError, "Cannot delete attribute: '%s'", attr);
return -1;
}