ecore_drm: Check list presence by NULL test instead of counting
authorDerek Foreman <derekf@osg.samsung.com>
Thu, 18 Feb 2016 19:34:23 +0000 (13:34 -0600)
committerMike Blumenkrantz <zmike@osg.samsung.com>
Thu, 18 Feb 2016 20:50:16 +0000 (15:50 -0500)
a count of < 1 will just be a NULL pointer, and a count of > 0 will
be non NULL, so we can simplify these conditionals.

src/lib/ecore_drm/ecore_drm_output.c

index 9322ab9..79df7ef 100644 (file)
@@ -792,7 +792,7 @@ _ecore_drm_outputs_update(Ecore_Drm_Device *dev)
 
         if (!(dev->conn_allocator & (1 << conn_id)))
           {
-             if (eina_list_count(dev->outputs) > 0)
+             if (dev->outputs)
                {
                   Ecore_Drm_Output *last;
 
@@ -958,7 +958,7 @@ next:
      }
 
    ret = EINA_TRUE;
-   if (eina_list_count(dev->outputs) < 1) 
+   if (!dev->outputs)
      ret = EINA_FALSE;
 
    /* free resources */