This patch swaps the "if (path)" block to "if (!path)"
therefore, the true block is now "error = 1" and the
false block is the call to get_rimage_from_file function.

The second change is that the "error = 1" statement is
changed to "return 0", because if "error" is "1", then
only the "return !error" statement is used, then we can
change it for "return !1" that is "return 0".

Then, we can move the get_rimage_from_file call out of the
if block.

Signed-off-by: Rodolfo García Peñas (kix) <[email protected]>
---
 src/icon.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/icon.c b/src/icon.c
index 560859c..554db7d 100644
--- a/src/icon.c
+++ b/src/icon.c
@@ -366,10 +366,10 @@ int wIconChangeImageFile(WIcon *icon, const char *file)
 
        /* Find the new image */
        path = FindImage(wPreferences.icon_path, file);
-       if (path)
-               image = get_rimage_from_file(scr, path, wPreferences.icon_size);
-       else
-               error = 1;
+       if (!path)
+               return 0;
+
+       image = get_rimage_from_file(scr, path, wPreferences.icon_size);
 
        /* New image! */
        if (!error && image) {
-- 
1.8.4.rc3


-- 
To unsubscribe, send mail to [email protected].

Reply via email to