Remove unnecessary null pointer checks

This commit is contained in:
Emmanuel Leblond 2016-01-04 11:46:16 +01:00
parent cb39db0b02
commit cabf923484
8 changed files with 10 additions and 19 deletions

View File

@ -217,8 +217,8 @@ b2Polygon::b2Polygon(b2Triangle& t) {
void b2Polygon::Set(const b2Polygon& p) {
if (nVertices != p.nVertices){
nVertices = p.nVertices;
if (x) delete[] x;
if (y) delete[] y;
delete[] x;
delete[] y;
x = new float32[nVertices];
y = new float32[nVertices];
}

View File

@ -139,7 +139,6 @@ void RtAudio :: getCompiledApi( std::vector<RtAudio::Api> &apis ) throw()
void RtAudio :: openRtApi( RtAudio::Api api )
{
if ( rtapi_ )
delete rtapi_;
rtapi_ = 0;
@ -216,7 +215,6 @@ RtAudio :: RtAudio( RtAudio::Api api )
RtAudio :: ~RtAudio() throw()
{
if ( rtapi_ )
delete rtapi_;
}

View File

@ -149,7 +149,6 @@ void OS_Unix::finalize_core() {
if (mempool_dynamic)
memdelete( mempool_dynamic );
if (mempool_static)
delete mempool_static;
}

View File

@ -118,7 +118,6 @@ void AudioDriverMediaKit::unlock() {
}
void AudioDriverMediaKit::finish() {
if (player)
delete player;
if (samples_in) {

View File

@ -16,9 +16,7 @@ HaikuDirectWindow::HaikuDirectWindow(BRect p_frame)
HaikuDirectWindow::~HaikuDirectWindow() {
if (update_runner) {
delete update_runner;
}
}
void HaikuDirectWindow::SetHaikuGLView(HaikuGLView* p_view) {

View File

@ -144,7 +144,6 @@ void OSNacl::finalize_core() {
if (mempool_dynamic)
memdelete( mempool_dynamic );
if (mempool_static)
delete mempool_static;
};

View File

@ -1144,7 +1144,6 @@ void OS_Windows::finalize_core() {
if (mempool_dynamic)
memdelete( mempool_dynamic );
if (mempool_static)
delete mempool_static;

View File

@ -345,7 +345,6 @@ void OSWinrt::finalize_core() {
if (mempool_dynamic)
memdelete( mempool_dynamic );
if (mempool_static)
delete mempool_static;
}