Remove unnecessary checks before delete (#9500)
authorNicolas Abril <nicolas.abril@gmail.com>
Tue, 10 Mar 2020 19:30:42 +0000 (19:30 +0000)
committerGitHub <noreply@github.com>
Tue, 10 Mar 2020 19:30:42 +0000 (20:30 +0100)
Co-authored-by: Nicolas Abril <nicolasabril@alunos.utfpr.edu.br>
src/map.cpp
src/mapgen/mapgen_fractal.cpp

index a6b9d398f4c1ca360f89036947a6e5fd152b7e70..40aba067e448fa5ee7a695e8f9c72a0dfe3dfcea 100644 (file)
@@ -1285,8 +1285,7 @@ ServerMap::~ServerMap()
                Close database if it was opened
        */
        delete dbase;
-       if (dbase_ro)
-               delete dbase_ro;
+       delete dbase_ro;
 
 #if 0
        /*
index cabe0b850e87cde79092919f1e6ceaa6ec135911..96febb4f4bb4dd8cb654f75271f36c2553c5b8a6 100644 (file)
@@ -90,9 +90,7 @@ MapgenFractal::MapgenFractal(MapgenFractalParams *params, EmergeManager *emerge)
 
 MapgenFractal::~MapgenFractal()
 {
-       if (noise_seabed)
-               delete noise_seabed;
-
+       delete noise_seabed;
        delete noise_filler_depth;
 }