[gparted] Simplify logic to ensure dmraid_devices cleared before populating



commit d63c97ef426b5045be7a102fdc449cce8dd4574f
Author: Curtis Gedak <gedakc gmail com>
Date:   Wed Sep 30 16:08:03 2009 -0600

    Simplify logic to ensure dmraid_devices cleared before populating

 src/DMRaid.cc |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)
---
diff --git a/src/DMRaid.cc b/src/DMRaid.cc
index 5f41c05..6e54f6e 100644
--- a/src/DMRaid.cc
+++ b/src/DMRaid.cc
@@ -65,18 +65,16 @@ void DMRaid::load_dmraid_cache()
 {
 	//Load data into dmraid structures
 	Glib::ustring output, error ;
+	dmraid_devices .clear() ;
+
 	if ( dmraid_found )
 	{
 		if ( ! Utils::execute_command( "dmraid -sa -c", output, error, true ) )
 		{
 			Glib::ustring temp = Utils::regexp_label( output, "^(no raid disks).*" ) ;
-			if ( temp == "no raid disks" )
-				dmraid_devices .clear() ;
-			else
+			if ( temp != "no raid disks" )
 				Utils::tokenize( output, dmraid_devices, "\n" ) ;
 		}
-		else
-			dmraid_devices .clear() ;
 	}
 }
 



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