wDockAttachIcon icon_editing is common in if else
authorRodolfo García Peñas (kix) <kix@kix.es>
Sat, 10 Nov 2012 18:25:53 +0000 (10 19:25 +0100)
committerCarlos R. Mafra <crmafra@gmail.com>
Sat, 10 Nov 2012 19:41:34 +0000 (10 19:41 +0000)
The line "icon_editing = 0" is the first line in the "if" sentence
and the first (and only) sentence in the "else" block, so can be
moved outside the if-else (and the empty else block can be removed).

src/dock.c

index c90ae93..58ef31a 100644 (file)
@@ -1854,11 +1854,11 @@ Bool wDockAttachIcon(WDock *dock, WAppIcon *icon, int x, int y)
        int index;
 
        wwin = icon->icon->owner;
+       icon->editing = 0;
+
        if (icon->command == NULL) {
                char *command;
 
-               icon->editing = 0;
-
                command = GetCommandForWindow(wwin->client_win);
                if (command) {
                        icon->command = command;
@@ -1893,8 +1893,6 @@ Bool wDockAttachIcon(WDock *dock, WAppIcon *icon, int x, int y)
                                }
                        }
                }
-       } else {
-               icon->editing = 0;
        }
 
        for (index = 1; index < dock->max_icons; index++)