[gparted] Bug #539092: Deletion of unnecessary null pointer checks



commit 1e2562adda8d315c36a709ce9b8086f3e2e97933
Author: Markus Elfring <elfring users sourceforge net>
Date:   Thu Jun 24 17:36:20 2010 +0200

    Bug #539092: Deletion of unnecessary null pointer checks
    
    A few null pointer checks were deleted because they were not needed any more.
    
    Signed-off-by: Markus Elfring <elfring users sourceforge net>

 src/Dialog_Base_Partition.cc |    3 +--
 src/Frame_Resizer_Base.cc    |    6 ++----
 src/GParted_Core.cc          |    6 ++----
 3 files changed, 5 insertions(+), 10 deletions(-)
---
diff --git a/src/Dialog_Base_Partition.cc b/src/Dialog_Base_Partition.cc
index 8f18c07..01dac76 100644
--- a/src/Dialog_Base_Partition.cc
+++ b/src/Dialog_Base_Partition.cc
@@ -344,8 +344,7 @@ void Dialog_Base_Partition::Check_Change()
 
 Dialog_Base_Partition::~Dialog_Base_Partition() 
 {
-	if ( frame_resizer_base )
-		delete frame_resizer_base ;
+	delete frame_resizer_base;
 }
 
 } //GParted
diff --git a/src/Frame_Resizer_Base.cc b/src/Frame_Resizer_Base.cc
index e94fdc7..746e55d 100644
--- a/src/Frame_Resizer_Base.cc
+++ b/src/Frame_Resizer_Base.cc
@@ -435,8 +435,6 @@ Frame_Resizer_Base::~Frame_Resizer_Base()
 	this ->get_colormap() ->free_colors( color_partition, 1 ) ;
 	this ->get_colormap() ->free_colors( color_arrow_rectangle, 1 ) ;
 	
-	if ( cursor_resize )
-		delete cursor_resize ;
-	if ( cursor_move )
-		delete cursor_move ;
+	delete cursor_resize;
+	delete cursor_move;
 }
diff --git a/src/GParted_Core.cc b/src/GParted_Core.cc
index 36e6bc5..c6d3ee9 100644
--- a/src/GParted_Core.cc
+++ b/src/GParted_Core.cc
@@ -2868,8 +2868,7 @@ bool GParted_Core::calculate_exact_geom( const Partition & partition_old,
 
 bool GParted_Core::set_proper_filesystem( const FILESYSTEM & filesystem )
 {
-	if ( p_filesystem )
-		delete p_filesystem ;
+	delete p_filesystem;
 		
 	switch( filesystem )
 	{
@@ -3112,8 +3111,7 @@ PedExceptionOption GParted_Core::ped_exception_handler( PedException * e )
 
 GParted_Core::~GParted_Core() 
 {
-	if ( p_filesystem )
-		delete p_filesystem ;
+	delete p_filesystem;
 }
 	
 } //GParted



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]