From 25741f93fac0dfcfe1de50e9304a2d94475e580d Mon Sep 17 00:00:00 2001 From: Sebastian Dransfeld Date: Wed, 23 Apr 2014 12:13:40 +0200 Subject: [PATCH] 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 130de88dc..cbb3a9669 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)