[baobab/next: 2/3] Remove redundant check



commit fb44d851c02c00acb3ab633c1bc9f44da4fd0eda
Author: Stefano Facchini <stefano facchini gmail com>
Date:   Wed Jun 10 23:25:11 2020 +0200

    Remove redundant check
    
    We already check for volume != null in the mount_volume method.

 src/baobab-window.vala | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)
---
diff --git a/src/baobab-window.vala b/src/baobab-window.vala
index ab306cb..072a9d2 100644
--- a/src/baobab-window.vala
+++ b/src/baobab-window.vala
@@ -245,18 +245,14 @@ namespace Baobab {
         void on_scan_location_activate (Location location) {
             set_active_location (location);
 
-            if (location.volume != null) {
-                location.mount_volume.begin ((location_, res) => {
-                    try {
-                        location.mount_volume.end (res);
-                        scan_active_location (false);
-                    } catch (Error e) {
-                        message (_("Could not analyze volume."), e.message, Gtk.MessageType.ERROR);
-                    }
-                });
-            } else {
-                scan_active_location (false);
-            }
+            location.mount_volume.begin ((location_, res) => {
+                try {
+                    location.mount_volume.end (res);
+                    scan_active_location (false);
+                } catch (Error e) {
+                    message (_("Could not analyze volume."), e.message, Gtk.MessageType.ERROR);
+                }
+            });
         }
 
         void on_reload_activate () {


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