Removed block in restore_icon_state
authorRodolfo García Peñas (kix) <kix@kix.es>
Tue, 2 Oct 2012 21:19:26 +0000 (2 23:19 +0200)
committerCarlos R. Mafra <crmafra@gmail.com>
Sat, 6 Oct 2012 14:29:58 +0000 (6 15:29 +0100)
The block inside restore_icon_state is not needed, so can be removed.

There are no changes with or without the block (variables scope,...).

src/dock.c

index 26d348a..c90ae93 100644 (file)
@@ -1343,6 +1343,7 @@ static WAppIcon *restore_icon_state(WScreen *scr, WMPropList *info, int type, in
 {
        WAppIcon *aicon;
        WMPropList *cmd, *value;
+       char *wclass, *winstance, *command;
 
        cmd = WMGetFromPLDictionary(info, dCommand);
        if (!cmd || !WMIsPLString(cmd))
@@ -1353,42 +1354,36 @@ static WAppIcon *restore_icon_state(WScreen *scr, WMPropList *info, int type, in
        if (!value)
                return NULL;
 
-       {
-               char *wclass, *winstance;
-               char *command;
-
-               ParseWindowName(value, &winstance, &wclass, "dock");
-
-               if (!winstance && !wclass)
-                       return NULL;
-
-               /* get commands */
+       ParseWindowName(value, &winstance, &wclass, "dock");
 
-               if (cmd)
-                       command = wstrdup(WMGetFromPLString(cmd));
-               else
-                       command = NULL;
-
-               if (!command || strcmp(command, "-") == 0) {
-                       if (command)
-                               wfree(command);
-                       if (wclass)
-                               wfree(wclass);
-                       if (winstance)
-                               wfree(winstance);
+       if (!winstance && !wclass)
+               return NULL;
 
-                       return NULL;
-               }
+       /* get commands */
+       if (cmd)
+               command = wstrdup(WMGetFromPLString(cmd));
+       else
+               command = NULL;
 
-               aicon = wAppIconCreateForDock(scr, command, winstance, wclass, TILE_NORMAL);
+       if (!command || strcmp(command, "-") == 0) {
+               if (command)
+                       wfree(command);
                if (wclass)
                        wfree(wclass);
                if (winstance)
                        wfree(winstance);
-               if (command)
-                       wfree(command);
+
+               return NULL;
        }
 
+       aicon = wAppIconCreateForDock(scr, command, winstance, wclass, TILE_NORMAL);
+       if (wclass)
+               wfree(wclass);
+       if (winstance)
+               wfree(winstance);
+       if (command)
+               wfree(command);
+
        aicon->icon->core->descriptor.handle_mousedown = iconMouseDown;
        if (type == WM_CLIP) {
                aicon->icon->core->descriptor.handle_enternotify = clipEnterNotify;