[libmanette] monitor: Remove preliminary property check



commit 88478c09f1d9ff37e025414566953c22a5cd94de
Author: vanadiae <vanadiae35 gmail com>
Date:   Sat Oct 10 18:02:11 2020 +0200

    monitor: Remove preliminary property check
    
    As g_udev_device_get_property will already return NULL if there's
    no such property for the device, and as such it won't match the
    g_strcmp0.

 src/manette-monitor.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/manette-monitor.c b/src/manette-monitor.c
index 6cd1f23..9ff0e12 100644
--- a/src/manette-monitor.c
+++ b/src/manette-monitor.c
@@ -168,8 +168,10 @@ udev_device_property_is (GUdevDevice *udev_device,
                          const gchar *property,
                          const gchar *value)
 {
-  return g_udev_device_has_property (udev_device, property) &&
-         (g_strcmp0 (g_udev_device_get_property (udev_device, property), value) == 0);
+  g_assert (property != NULL);
+  g_assert (value != NULL);
+
+  return g_strcmp0 (g_udev_device_get_property (udev_device, property), value) == 0;
 }
 
 static gboolean


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