[Path] remove superfluous nullptr checks
This commit is contained in:
@@ -192,7 +192,7 @@ void Voronoi::colorExterior(const Voronoi::diagram_type::edge_type *edge, std::s
|
||||
edge->color(colorValue);
|
||||
edge->twin()->color(colorValue);
|
||||
auto v = edge->vertex1();
|
||||
if (v == nullptr || !edge->is_primary()) {
|
||||
if (!v || !edge->is_primary()) {
|
||||
return;
|
||||
}
|
||||
v->color(colorValue);
|
||||
|
||||
@@ -55,7 +55,7 @@ VoronoiCell::~VoronoiCell() {
|
||||
}
|
||||
|
||||
bool VoronoiCell::isBound(void) const {
|
||||
if (ptr != nullptr && dia.isValid() && index != Voronoi::InvalidIndex) {
|
||||
if (ptr && dia.isValid() && index != Voronoi::InvalidIndex) {
|
||||
if (&(dia->cells()[index]) == ptr) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ VoronoiEdge::~VoronoiEdge() {
|
||||
}
|
||||
|
||||
bool VoronoiEdge::isBound(void) const {
|
||||
if (ptr != nullptr && dia.isValid() && index != Voronoi::InvalidIndex) {
|
||||
if (ptr && dia.isValid() && index != Voronoi::InvalidIndex) {
|
||||
if (&(dia->edges()[index]) == ptr) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -188,7 +188,7 @@ static bool callbackWithVertex(Voronoi::diagram_type *dia, PyObject *callback, c
|
||||
#endif
|
||||
Py_DECREF(arglist);
|
||||
Py_DECREF(vx);
|
||||
if (result == nullptr) {
|
||||
if (!result) {
|
||||
bail = true;
|
||||
} else {
|
||||
rc = result == Py_True;
|
||||
|
||||
@@ -56,7 +56,7 @@ VoronoiVertex::~VoronoiVertex() {
|
||||
}
|
||||
|
||||
bool VoronoiVertex::isBound(void) const {
|
||||
if (ptr != nullptr && dia.isValid() && index != Voronoi::InvalidIndex) {
|
||||
if (ptr && dia.isValid() && index != Voronoi::InvalidIndex) {
|
||||
if (&(dia->vertices()[index]) == ptr) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user