[gnome-settings-daemon/gnome-3-20] common: Merge "if device" conditionals



commit 56fa5d69dd03f436720b95b2c677615f26a2e918
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Oct 7 18:40:15 2016 +0200

    common: Merge "if device" conditionals
    
    We have 2 checks for the same thing within a couple of lines. Merge
    those.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=772581

 plugins/common/gsd-device-manager-x11.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
---
diff --git a/plugins/common/gsd-device-manager-x11.c b/plugins/common/gsd-device-manager-x11.c
index 14f6e72..b1795df 100644
--- a/plugins/common/gsd-device-manager-x11.c
+++ b/plugins/common/gsd-device-manager-x11.c
@@ -137,10 +137,8 @@ remove_device (GsdX11DeviceManager *manager,
 
        device = g_hash_table_lookup (manager->devices, device_file);
 
-       if (device)
-               g_object_ref (device);
-
        if (device) {
+               g_object_ref (device);
                g_signal_emit_by_name (manager, "device-removed", device);
                g_object_unref (device);
        }


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