diff options
author | taiyu <[email protected]> | 2015-09-01 09:02:26 -0700 |
---|---|---|
committer | taiyu <[email protected]> | 2015-09-01 09:02:26 -0700 |
commit | 972748e674918dea00533ef895748577dfb7759b (patch) | |
tree | 810e78292b6bf80337af70200f6ae55a2579e80d /sway/commands.c | |
parent | 9eb5ba49614d5934108dc4da18419b033c976e5b (diff) |
cleaned up leaky prev_workspace_name
Diffstat (limited to 'sway/commands.c')
-rw-r--r-- | sway/commands.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/sway/commands.c b/sway/commands.c index 177c54ab..6e74a442 100644 --- a/sway/commands.c +++ b/sway/commands.c @@ -822,11 +822,8 @@ static bool cmd_workspace(struct sway_config *config, int argc, char **argv) { } if (strcasecmp(argv[0], "back_and_forth") == 0) { if (prev_workspace_name) { - if (workspace_by_name(prev_workspace_name)) { - workspace_switch(workspace_by_name(prev_workspace_name)); - } else { - workspace_switch(workspace_create(prev_workspace_name)); - } + swayc_t *ws = workspace_by_name(prev_workspace_name); + workspace_switch(ws ? ws : workspace_create(prev_workspace_name)); } return true; } |