From 91209e194c9dc68190e71e48af559effce546f65 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Wed, 25 Apr 2018 10:44:31 +0200 Subject: [PATCH] Remove useless tests after operator new --- utils/idftools/vrml_layer.cpp | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/utils/idftools/vrml_layer.cpp b/utils/idftools/vrml_layer.cpp index bce50ac0ba..064780b342 100644 --- a/utils/idftools/vrml_layer.cpp +++ b/utils/idftools/vrml_layer.cpp @@ -318,9 +318,6 @@ int VRML_LAYER::NewContour( bool aPlatedHole ) std::list* contour = new std::list; - if( !contour ) - return -1; - contours.push_back( contour ); areas.push_back( 0.0 ); @@ -348,13 +345,6 @@ bool VRML_LAYER::AddVertex( int aContourID, double aXpos, double aYpos ) } VERTEX_3D* vertex = new VERTEX_3D; - - if( !vertex ) - { - error = "AddVertex(): a new vertex could not be allocated"; - return false; - } - vertex->x = aXpos; vertex->y = aYpos; vertex->i = idx++; @@ -1409,12 +1399,6 @@ VERTEX_3D* VRML_LAYER::AddExtraVertex( double aXpos, double aYpos, bool aPlatedH { VERTEX_3D* vertex = new VERTEX_3D; - if( !vertex ) - { - error = "AddExtraVertex(): could not allocate a new vertex"; - return NULL; - } - if( eidx == 0 ) eidx = idx + hidx; @@ -1463,9 +1447,6 @@ void VRML_LAYER::glEnd( void ) // add the loop to the list of outlines std::list* loop = new std::list; - if( !loop ) - break; - double firstX = 0.0; double firstY = 0.0; double lastX = 0.0;