englebass pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=25741f93fac0dfcfe1de50e9304a2d94475e580d

commit 25741f93fac0dfcfe1de50e9304a2d94475e580d
Author: Sebastian Dransfeld <[email protected]>
Date:   Wed Apr 23 12:13:40 2014 +0200

    backlight: Only check output name if sysdev is set
    
    We only have an action inside the for loop if sysdev is set, so move the
    check outside the for loop.
---
 src/bin/e_backlight.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/src/bin/e_backlight.c b/src/bin/e_backlight.c
index 130de88..cbb3a96 100644
--- a/src/bin/e_backlight.c
+++ b/src/bin/e_backlight.c
@@ -277,18 +277,20 @@ _e_backlight_set(E_Zone *zone, double val)
         if ((out) && (num > 0))
           {
              Eina_Bool gotten = EINA_FALSE;
-             for (i = 0; i < num; i++)
+             if (e_config->backlight.sysdev)
                {
-                  name = ecore_x_randr_output_name_get(root, out[i], NULL);
-                  if (name)
+                  for (i = 0; i < num; i++)
                     {
-                       if ((e_config->backlight.sysdev) &&
-                           (!strcmp(name, e_config->backlight.sysdev)))
+                       name = ecore_x_randr_output_name_get(root, out[i], 
NULL);
+                       if (name)
                          {
-                            ecore_x_randr_output_backlight_level_set(root, 
out[i], val);
-                            gotten = EINA_TRUE;
+                            if (!strcmp(name, e_config->backlight.sysdev))
+                              {
+                                 
ecore_x_randr_output_backlight_level_set(root, out[i], val);
+                                 gotten = EINA_TRUE;
+                              }
+                            free(name);
                          }
-                       free(name);
                     }
                }
              if (!gotten)

-- 


Reply via email to